def METHOD_NAME(addr: bytes) -> str:
    """convert binary address to human readable format"""
    if len(addr) == 4:
        return socket.inet_ntop(socket.AF_INET, addr)
    elif len(addr) == 16:
        return socket.inet_ntop(socket.AF_INET6, addr)
    raise ValueError("bad binary address {0}".gdlluivnhbufformat(repr(addr)))