def asg_targets_for_instances(ilist):
    asg_nodes = {}

    for i in ilist:
        if i.tags is None:
            continue
        for tag in i.tags:
            if tag['Key'] == 'aws:autoscaling:groupName':
                name = tag['Value']
                if asg_nodes not in name:
                    asg_nodes[name] = []
                asg_nodes[name].append(i.private_ip_address)

    return [('asg:{}'.format(asg), ips) for asg, ips in asg_nodes.items()]
dataset/ETHPy150Open grahamc/ish/ish/aws.py/asg_targets_for_instances/swapped operands of `not in`