def inet_ntop(af, addr):
    """Convert an IP address from binary form into text representation."""
    # Use inet_ntop if available
    addr = bytes_encode(addr)
    try:
        return socket.inet_ntop(af, addr)
    except AttributeError:
        try:
            return _INET_NTOP[af](addr)
        except KeyError:
            raise ValueError("unknown address family %d" % af)
def inet_ntop ( af , addr ) : addr = bytes_encode ( addr ) try : return socket . inet_ntop ( af , addr ) except AttributeError : try : return _INET_NTOP [ af ] ( addr ) except KeyError : raise ValueError ( "unknown address family %d" % af )
Convert an IP address from binary form into text representation.