def METHOD_NAME(addr):
    try:
        socket.inet_pton(socket.AF_INET, addr)
        return socket.AF_INET
    except Exception as e:
        pass
    try:
        socket.inet_pton(socket.AF_INET6, addr)
        return socket.AF_INET6
    except Exception as e:
        pass
    if os.path.exists(addr):
        return socket.AF_UNIX
    return None