code: def reraise_with_context(
      error_cls: Type[Exception],
  ) -> Iterator[None]:
      """Contextmanager which reraises an exception with an additional message.
  
      Args:
        error_cls: The exception to be reraised.
  
      Yields:
        None.
      """
      # If current_context_msg exists, we are already within the scope of the
      # session contextmanager.
      if hasattr(context_holder, "current_context_msg"):
          yield
          return
  
      context_holder.current_context_msg = ErrorContext()
      try:
          yield
      except error_cls as e:
          context_msg = "\n".join(
              context_holder.current_context_msg.messages
          )
          utils.reraise(e, suffix=context_msg)
      finally:
          del context_holder.current_context_msg
  
imports: import contextlib
  import dataclasses
  import threading
  from typing import Callable, Iterator, List, Type, Union
  from tensorflow_datasets.core import utils
label_desc: Use image node_id 1 for calling a global function with example usage: reraise_with_context(error_cls) without return types