def main():

    # First we have to create our client.
    api_client = client_module.RestApiClient(version='5.0')

    # Prompt the user for an IP address.
    ip = prompt_for_ip()

    if ip is None:
        sys.exit(1)

    # Get all source addresses associated with the IP address.
    source_addresses = get_source_addresses_for_ip(api_client, ip)

    if source_addresses is None:
        sys.exit(1)

    # Get all local destination addresses associated with the IP address.
    local_destination_addresses = get_local_destination_addresses_for_ip(
        api_client, ip)

    if local_destination_addresses is None:
        sys.exit(1)

    # Combine all offense IDs returned in any of the source or local
    # destination addresses into a single set of unique offense ids.
    offense_ids = set()
    for source_address in source_addresses:
        offense_ids = offense_ids | set(source_address['offense_ids'])
    for local_destination_address in local_destination_addresses:
        offense_ids = (
            offense_ids | set(local_destination_address['offense_ids']))

    # If the set of offense IDs is empty, exit
    if len(offense_ids) == 0:
        print("The set of offense IDs is empty. Cannot continue.")
        sys.exit(1)

    # Generate the filter we will use to return only the offenses associated
    # with the IP address.
    offense_id_filter = generate_filter_from_array('id', offense_ids)

    # Get the offenses associated with the IP address.
    offenses = get_offenses(api_client, offense_id_filter)

    print("The following offenses are associated with the IP address " + ip +
          ":")
    print(json.dumps(offenses, indent=4))
Removes the authenticated user's cookies and session object.
dataset/ETHPy150Open ibm-security-intelligence/api-samples/siem/09_GetOffensesForIp.py/main--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.2/django/test/client.py/Client.logout