def unassigned(data, as_json=False):
no_subusers = set()<EOL>if not isinstance(data, list):<EOL><INDENT>return format_ret(no_subusers, as_json=as_json)<EOL><DEDENT>for current in data:<EOL><INDENT>num_subusers = len(current["<STR_LIT>"])<EOL>if num_subusers == <NUM_LIT:0>:<EOL><INDENT>current_ip = current["<STR_LIT>"]<EOL>no_subusers.add(current_ip)<EOL><DEDENT><DEDENT>ret_val = format_ret(no_subusers, as_json=as_json)<EOL>return ret_val<EOL>
https://sendgrid.com/docs/API_Reference/api_v3.html#ip-addresses
        The /ips rest endpoint returns information about the IP addresses
        and the usernames assigned to an IP

        unassigned returns a listing of the IP addresses that are allocated
        but have 0 users assigned


        data (response.body from sg.client.ips.get())
        as_json False -> get list of dicts
                True  -> get json object

        example:
        sg = sendgrid.SendGridAPIClient(os.environ.get('SENDGRID_API_KEY'))

        params = {
            'subuser': 'test_string',
            'ip': 'test_string',
            'limit': 1,
            'exclude_whitelabels':
            'true', 'offset': 1
        }
        response = sg.client.ips.get(query_params=params)
        if response.status_code == 201:
           data = response.body
           unused = unassigned(data)