def get_fair_hosts_list(affinity_hosts_list, nb_hosts):
    hosts_list = []

    while (len(hosts_list) < nb_hosts):
        for hypervisor in affinity_hosts_list.keys():
            if (len(affinity_hosts_list[hypervisor]) == 0):
                return hosts_list
            hosts_list.append(affinity_hosts_list[hypervisor].pop())
            if (len(hosts_list) == nb_hosts):
                break

    return hosts_list
dataset/ETHPy150Open redhat-cip/edeploy/src/health-server.py/get_fair_hosts_list/original