<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Replace YOUR_KEY with your OTX API key. You can find it in your settings page https
Step1:  Let's list a few pulses
Step2:  author_name
Step3:  _id
Step4:  Besides receiving the pulse information, there is another function that can retrieve different events that are ocurring in the OTX system and affect your account.
<ASSISTANT_TASK:>
Python Code:
pulses = otx.getall()
len(pulses)
Explanation: Replace YOUR_KEY with your OTX API key. You can find it in your settings page https://otx.alienvault.com/settings
The getall() method downloads all the OTX pulses and their assocciated indicators of compromise (IOCs) from your account. This includes all of the following:
- OTX pulses to which you subscribed through the web UI
- Pulses created by OTX users to whom you subscribe
- OTX pulses you created. 
If this is the first time you are using your account, the download includes all pulses created by AlienVault. All users are subscribed to these by default.
End of explanation
json_normalize(pulses)[0:5]
Explanation: Let's list a few pulses
End of explanation
json_normalize(pulses[1]["indicators"])
Explanation: author_name: The username of the OTX User that created the pulse
created: Date when the pulse was created in the system
description: Describes the pulse in terms of the type of threat it poses, and any other facts that may link it to other threat indicators.
id: Unique identifier of the pulse
indicators: Collection of Indicators Of Compromise 
modified: Date when the pulse was last modified
name: Name of the pulse
references: List of references to papers, websites or blogs related to the threat described in the pulse
revision: Revision number that increments each time pulse contents change
tags: List of tags that provide information about pulse content, for example, Phshing, malware, C&C, and apt.
Let's explore the indicators object:
End of explanation
indicator_types = [
			{
			    "name": "IPv4", 
			    "description": "An IPv4 address indicating the online location of a server or other computer."
			}, 
			{
			    "name": "IPv6", 
			    "description": "An IPv6 address indicating the online location of a server or other computer."
			}, 
			{
			    "name": "domain", 
			    "description": "A domain name for a website or server. Domains encompass a series of hostnames."
			}, 
			{
			    "name": "hostname", 
			    "description": "The hostname for a server located within a domain."
			}, 
			{
			     
			    "name": "email", 
			    "description": "An email associated with suspicious activity."
			}, 
			{
			    "name": "URL", 
			    "description": " Uniform Resource Location (URL) summarizing the online location of a file or resource."
			}, 
			{
			     
			    "name": "URI", 
			    "description": "Uniform Resource Indicator (URI) describing the explicit path to a file hosted online."
			}, 
			{
			    "name": "FileHash-MD5", 
			    "description": "A MD5-format hash that summarizes the architecture and content of a file."
			}, 
			{
			    "name": "FileHash-SHA1", 
			    "description": "A SHA-format hash that summarizes the architecture and content of a file."
			}, 
			{
			    "name": "FileHash-SHA256", 
			    "description": "A SHA-256-format hash that summarizes the architecture and content of a file."
			}, 
			{
			     
			    "name": "FileHash-PEHASH", 
			    "description": "A PEPHASH-format hash that summarizes the architecture and content of a file."
			}, 
			{
			     
			    "name": "FileHash-IMPHASH", 
			    "description": "An IMPHASH-format hash that summarizes the architecture and content of a file."
			}, 
			{
			    "name": "CIDR", 
			    "description": "Classless Inter-Domain Routing (CIDR) address, which describes both a server's IP address and the network architecture (routing path) surrounding that server."
			}, 
			{
			     
			    "name": "FilePath", 
			    "description": "A unique location in a file system."
			}, 
			{
			     
			    "name": "Mutex", 
			    "description": "The name of a mutex resource describing the execution architecture of a file."
			}, 
			{
			    "name": "CVE", 
			    "description": "Common Vulnerability and Exposure (CVE) entry describing a software vulnerability that can be exploited to engage in malicious activity."
			}]
json_normalize(indicator_types)
mtime = (datetime.now() - timedelta(days=1)).isoformat()
mtime
Explanation: _id: Unique identifier of the IOC
created: Date IOC was added to the pulse
description: Describe the Indicator Of Compromise
indicator: The IOC
indicator_type: Type of indicator
The following Indicator Types are supported:
End of explanation
events = otx.getevents_since(mtime)
json_normalize(events)
Explanation: Besides receiving the pulse information, there is another function that can retrieve different events that are ocurring in the OTX system and affect your account.
End of explanation
<END_TASK>