def validate_and_normalize_address(address):
    new_address = address.lstrip('[').rstrip(']')
    if address.startswith('[') and address.endswith(']'):
        return validate_and_normalize_ip(new_address)

    new_address = new_address.lower()
    if is_valid_ipv4(new_address):
        return new_address
    elif is_valid_ipv6(new_address):
        return expand_ipv6(new_address)
    elif is_valid_hostname(new_address):
        return new_address
    else:
        raise ValueError('Invalid address %s' % address)
Retrieve a list of nodes with detail.
dataset/ETHPy150Open openstack/swift/swift/common/ring/utils.py/validate_and_normalize_address--crossover with--dataset/ETHPy150Open openstack/ironic/ironic/api/controllers/v1/node.py/NodesController.detail