code: def sampled(self) -> int:
      from opentelemetry import trace
  
      span = trace.get_current_span()
      if span is None:
          return 0
      return 1 if span.get_span_context().trace_flags.sampled else 0
  
imports: from __future__ import annotations
  import contextlib
  import contextvars
  import os
  import typing
  from abc import ABC
  from abc import abstractmethod
  from typing import TYPE_CHECKING
  import attr
  import starlette.datastructures
  from .utils.http import Cookie
label_desc: Use image node_id 2 for calling the _ServiceTraceContext obj's underlying member method code with example usage: obj.sampled() and returns: unknown, int