code: def scoped_labels(labels: Dict[str, str]):
      """Register thread local labels used in current context."""
      if (
          getattr(_thread_local_labels_state, "dictionary", None)
          is None
      ):
          _thread_local_labels_state.dictionary = {}
      for key, value in labels.items():
          _thread_local_labels_state.dictionary[key] = value
      try:
          yield
      finally:
          for key in labels:
              _thread_local_labels_state.dictionary.pop(key)
  
file_path: tfx/tfx/utils/telemetry_utils.py
imports: import contextlib
  import functools
  import re
  import sys
  import threading
  from typing import Dict, List, Any, Callable
  from absl import logging
  from googleapiclient import http
  from tfx import version
label_desc: Use image node_id 1 for calling a global function with example usage: scoped_labels(labels) without return types