def address_lookup(hypervisor, address_pool):
    """Retrieves a valid and available network IP address."""
    address_pool = set(address_pool)
    active_addresses = set(active_network_addresses(hypervisor))

    try:
        return random.choice(tuple(address_pool - active_addresses))
    except IndexError:
        raise RuntimeError("All IP addresses are in use")
def address_lookup ( hypervisor , address_pool ) : address_pool = set ( address_pool ) active_addresses = set ( active_network_addresses ( hypervisor ) ) try : return random . choice ( tuple ( address_pool - active_addresses ) ) except IndexError : raise RuntimeError ( "All IP addresses are in use" )
Retrieves a valid and available network IP address.