def get_source_addresses_for_ip(api_client, ip):

    endpoint = 'siem/source_addresses'
    params = {'filter': 'source_ip="' + ip + '"'}

    response = api_client.call_api(endpoint, 'GET', params=params,
                                   print_request=True)
    response_body = response.read().decode('utf-8')

    if response.code > 299 or response.code < 200:

        print("Failed to get source addresses.")
        print(response_body)
        return None

    source_addresses = json.loads(response_body)

    return source_addresses
Generate a filter for the source_ip field based on the provided ip
dataset/ETHPy150Open ibm-security-intelligence/api-samples/siem/09_GetOffensesForIp.py/get_source_addresses_for_ip