def _decode_thrift_span(self, thrift_span):
parent_id = None<EOL>local_endpoint = None<EOL>annotations = {}<EOL>tags = {}<EOL>kind = Kind.LOCAL<EOL>remote_endpoint = None<EOL>timestamp = None<EOL>duration = None<EOL>if thrift_span.parent_id:<EOL><INDENT>parent_id = self._convert_unsigned_long_to_lower_hex(<EOL>thrift_span.parent_id,<EOL>)<EOL><DEDENT>if thrift_span.annotations:<EOL><INDENT>annotations, local_endpoint, kind, timestamp, duration =self._decode_thrift_annotations(thrift_span.annotations)<EOL><DEDENT>if thrift_span.binary_annotations:<EOL><INDENT>tags, local_endpoint, remote_endpoint =self._convert_from_thrift_binary_annotations(<EOL>thrift_span.binary_annotations,<EOL>)<EOL><DEDENT>trace_id = self._convert_trace_id_to_string(<EOL>thrift_span.trace_id,<EOL>thrift_span.trace_id_high,<EOL>)<EOL>return Span(<EOL>trace_id=trace_id,<EOL>name=thrift_span.name,<EOL>parent_id=parent_id,<EOL>span_id=self._convert_unsigned_long_to_lower_hex(thrift_span.id),<EOL>kind=kind,<EOL>timestamp=self.seconds(timestamp or thrift_span.timestamp),<EOL>duration=self.seconds(duration or thrift_span.duration),<EOL>local_endpoint=local_endpoint,<EOL>remote_endpoint=remote_endpoint,<EOL>shared=(kind == Kind.SERVER and thrift_span.timestamp is None),<EOL>annotations=annotations,<EOL>tags=tags,<EOL>)<EOL>
Decodes a thrift span.

        :param thrift_span: thrift span
        :type thrift_span: thrift Span object
        :returns: span builder representing this span
        :rtype: Span