code: def experiment_singleton() -> Experiment:
      global _internal
  
      if _internal is None:
          raise RuntimeError(
              "Experiment not created. "
              "Create an experiment first with `experiment.create`"
              " or `experiment.record`"
          )
  
      return _internal
  
imports: import json
  import os
  import pathlib
  import time
  from typing import Optional, Set, Dict, Union, TYPE_CHECKING
  from labml import logger
  from labml.logger import Text
  from labml.utils import get_caller_file
  from labml.utils.git_info import get_git_status
  from labml.utils.notice import labml_notice
  from ..app.dynamic import DynamicUpdateHandler
  from ..configs.base import Configs
  from ..configs.dynamic_hyperparam import DynamicHyperParam
  from ..configs.processor import ConfigProcessor, FileConfigsSaver
  from ..experiment.experiment_run import Run
  from ..experiment.watcher import ExperimentWatcher
  from ..lab import lab_singleton
  from ..monitor import monitor_singleton
  from ..tracker import tracker_singleton
  from ..util import is_ipynb
label_desc: Use image node_id 3 for calling a global function with example usage: experiment_singleton() and returns: _internal