def opsworks_instance_stack_targets_for_instances(ilist):
    """
    Generate targets list by opwsorks stack name
    """
    ois_nodes = {}

    for i in ilist:
        if i.tags is None:
            continue
        for tag in i.tags:
            if tag['Key'] == 'opsworks:stack':
                name = tag['Value']
                if ois_nodes not in name:
                    ois_nodes[name] = []
                ois_nodes[name].append(i.private_ip_address)

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