docs: def get_trace_id():
      """Parse X-Ray Trace ID environment variable.
  
      The value looks something like this:
  
          Root=1-5901e3bc-8da3814a5f3ccbc864b66ecc;Parent=328f72132deac0ce;Sampled=1
  
      `Root` is the main X-Ray Trace ID, `Parent` points to the top-level
      segment, and `Sampled` shows whether the current request should be traced
      or not.
  
      If the environment variable doesn't exist, just return an `XRayTraceID`
      instance with default values, which means that tracing will be skipped
      due to `sampled` being set to `False`.
      """
      raw_trace_id = os.environ.get('_X_AMZN_TRACE_ID', '')
      trace_id_parts = raw_trace_id.split(';')
      trace_kwargs = {
          'trace_id': None,
          'parent_id': None,
          'sampled': False,
      }
      if trace_id_parts[0] != '':
          # This means the trace ID environment variable is not empty
          for part in trace_id_parts:
              name, value = part.split('=')
              if name == 'Root':
                  trace_kwargs['trace_id'] = value
              elif name == 'Parent':
                  trace_kwargs['parent_id'] = value
              elif name == 'Sampled':
                  trace_kwargs['sampled'] = bool(int(value))
  
      return XRayTraceID(**trace_kwargs)