def _decode_proc_address_encoding(addr):
 (ip, port) = addr.split(':')
 port = int(port, 16)
 if (sys.version_info >= (3,)):
  ip = ip.encode('ascii')
 if (sys.byteorder == 'little'):
  ip = socket.inet_ntop(socket.AF_INET, base64.b16decode(ip)[::(-1)])
 else:
  ip = socket.inet_ntop(socket.AF_INET, base64.b16decode(ip))
 return (ip, port)

def _decode_proc_address_encoding ( addr ) : ( ip , port ) = addr . split ( ':' ) port = int ( port , 16 ) if ( sys . version_info >= ( 3 , ) ) : ip = ip . encode ( 'ascii' ) if ( sys . byteorder == 'little' ) : ip = socket . inet_ntop ( socket . AF_INET , base64 . b16decode ( ip ) [ : : ( - 1 ) ] ) else : ip = socket . inet_ntop ( socket . AF_INET , base64 . b16decode ( ip ) ) return ( ip , port )
translates an address entry in the /proc/net/* contents to a human readable form (reference <URL for instance: "0500000a:0016" -> .