def _convert_from_thrift_endpoint(self, thrift_endpoint):
ipv4 = None<EOL>ipv6 = None<EOL>port = struct.unpack('<STR_LIT:H>', struct.pack('<STR_LIT:h>', thrift_endpoint.port))[<NUM_LIT:0>]<EOL>if thrift_endpoint.ipv4 != <NUM_LIT:0>:<EOL><INDENT>ipv4 = socket.inet_ntop(<EOL>socket.AF_INET,<EOL>struct.pack('<STR_LIT>', thrift_endpoint.ipv4),<EOL>)<EOL><DEDENT>if thrift_endpoint.ipv6:<EOL><INDENT>ipv6 = socket.inet_ntop(socket.AF_INET6, thrift_endpoint.ipv6)<EOL><DEDENT>return Endpoint(<EOL>service_name=thrift_endpoint.service_name,<EOL>ipv4=ipv4,<EOL>ipv6=ipv6,<EOL>port=port,<EOL>)<EOL>
Accepts a thrift decoded endpoint and converts it to an Endpoint.

        :param thrift_endpoint: thrift encoded endpoint
        :type thrift_endpoint: thrift endpoint
        :returns: decoded endpoint
        :rtype: Encoding