code: def to_headers(self, span_context):
          
          trace_id = span_context.trace_id
          span_id = span_context.span_id
          trace_options = span_context.trace_options.enabled
  
          # Convert the trace options
          trace_options = '01' if trace_options else '00'
  
          headers = {
              _TRACEPARENT_HEADER_NAME: '00-{}-{}-{}'.format(
                  trace_id,
                  span_id,
                  trace_options
              ),
          }
          tracestate = span_context.tracestate
          if tracestate:
              headers[_TRACESTATE_HEADER_NAME] = \
                  TracestateStringFormatter().to_string(tracestate)
          return headers
docs: Convert a SpanContext object to W3C Distributed Tracing headers,
          using version 0.
  
          :type span_context:
              :class:`~opencensus.trace.span_context.SpanContext`
          :param span_context: SpanContext object.
  
          :rtype: dict
          :returns: W3C Distributed Tracing headers.