code: def check_active() -> None:
      """Checks that the main _EventObserver observer thread is active.
  
      Silently does nothing if not in an init() context.
      """
      global _event_observer
      global _event_observer_lock
      with _event_observer_lock:
          if _event_observer:
              if _event_observer.done():
                  ex = _event_observer.exception()
                  if ex:
                      raise ValueError(
                          "_EventObserver observer thread unexpectedly "
                          "terminated with exception"
                      ) from ex
                  else:
                      raise ValueError(
                          "_EventObserver observer thread unexpectedly "
                          "terminated, but with no exception"
                      )
  
imports: from concurrent import futures
  import contextlib
  import dataclasses
  import queue
  import threading
  from typing import Any, Callable, List, Optional, Union
  from absl import logging
  from tfx.orchestration.experimental.core import task
  from tfx.utils import status
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 3 for calling a global function with example usage: check_active() without return types