def _convert_endpoint(endpoint):
pb_endpoint = zipkin_pb2.Endpoint()<EOL>if endpoint.service_name:<EOL><INDENT>pb_endpoint.service_name = endpoint.service_name<EOL><DEDENT>if endpoint.port and endpoint.port != <NUM_LIT:0>:<EOL><INDENT>pb_endpoint.port = endpoint.port<EOL><DEDENT>if endpoint.ipv4:<EOL><INDENT>pb_endpoint.ipv4 = socket.inet_pton(socket.AF_INET, endpoint.ipv4)<EOL><DEDENT>if endpoint.ipv6:<EOL><INDENT>pb_endpoint.ipv6 = socket.inet_pton(socket.AF_INET6, endpoint.ipv6)<EOL><DEDENT>return pb_endpoint<EOL>
Converts py_zipkin's Endpoint to Protobuf's Endpoint.

    :param endpoint: py_zipkins' endpoint to convert.
    :type endpoint: py_zipkin.encoding.Endpoint
    :return: corresponding protobuf's endpoint.
    :rtype: zipkin_pb2.Endpoint