# Import requests for making API calls import requests # Import netaddr for manipulating CIDRs import netaddr # Import sys for accessing command line arguments import sys # Check if an org_handle was provided as a command line argument if len(sys.argv) > 1: # Get the org_handle from the first argument org_handle = sys.argv[1] else: # Print an error message and exit if no org_handle was given print("Please provide an organization handle as a command line argument.") sys.exit(1) # Define the base URL for ARIN's Whois-RWS API base_url = "https://whois.arin.net/rest/" # Define the headers for requesting XML data headers = {"Accept": "application/xml"} # Make a GET request to get the networks for the organization response = requests.get(base_url + "org/" + org_handle + "/nets", headers=headers) # Check if the response status code is 200 (OK) if response.status_code == 200: # Parse the XML data from the response xml_data = response.text # Initialize an empty list for storing CIDRs cidrs = [] # Loop through each network element in the XML data for net in xml_data.split("