code: def _get_parent_trace_state(
      parent_context: "Context",
  ) -> t.Optional["TraceState"]:
      parent_span_context = get_current_span(
          parent_context
      ).get_span_context()
      if (
          parent_span_context is None
          or not parent_span_context.is_valid
      ):
          return None
      return parent_span_context.trace_state
  
file_path: BentoML/grpc-client/bentoml/_internal/utils/telemetry.py
imports: import typing
  from typing import TYPE_CHECKING
  from opentelemetry.sdk.trace.sampling import ALWAYS_ON
  from opentelemetry.sdk.trace.sampling import Decision
  from opentelemetry.sdk.trace.sampling import ParentBased
  from opentelemetry.sdk.trace.sampling import SamplingResult
  from opentelemetry.sdk.trace.sampling import StaticSampler
  from opentelemetry.sdk.trace.sampling import TraceIdRatioBased
  from opentelemetry.trace import get_current_span
label_desc: Use image node_id 1 for calling a global function with example usage: _get_parent_trace_state(parent_context) and returns: parent_span_context, None