def dump_affinity(bench, bench_type):
    HP.logger.debug("Using affinity %s on the following mapping :" % bench['affinity'])
    host_affinity = compute_affinity(bench)
    final_list = {}

    if bench_type == HM.NETWORK:
        return bench['hosts-list']

    for hypervisor in host_affinity.keys():
        for hostname in bench['hosts-list']:
            if hostname in host_affinity[hypervisor]:
                if final_list.keys() not in hypervisor:
                    final_list[hypervisor] = [hostname]
                else:
                    final_list[hypervisor].append(hostname)
    return final_list
dataset/ETHPy150Open redhat-cip/edeploy/src/health-server.py/dump_affinity/swapped operands of `not in`