code: def _dummy_init(
      *,
      distributed: Optional[core.DistributedContext] = None,
      checkpoint_storage: Optional[Union[str, Dict[str, Any]]] = None,
      tensorboard_path: Optional[pathlib.Path] = None,
      preempt_mode: core.PreemptMode = core.PreemptMode.WorkersAskChief,
  ) -> Context:
      """
      Build a core.Context suitable for running off-cluster.  This is normally called by init()
      when it is detected that there is no ClusterInfo available, but can be invoked directly for
      e.g. local test mode.
      """
      distributed = distributed or core.DummyDistributedContext()
      preempt = core.DummyPreemptContext(distributed, preempt_mode)
  
      storage_manager = _get_storage_manager(checkpoint_storage)
  
      if storage_manager is None:
          base_path = appdirs.user_data_dir("determined")
          logger.info(
              f"no storage_manager provided; storing checkpoints in {base_path}"
          )
          storage_manager = storage.SharedFSStorageManager(base_path)
      checkpoint = core.DummyCheckpointContext(
          distributed, storage_manager
      )
  
      train = core.DummyTrainContext(tensorboard_path)
      searcher = core.DummySearcherContext(distributed)
  
      _install_stacktrace_on_sigusr1()
  
      return Context(
          distributed=distributed,
          checkpoint=checkpoint,
          preempt=preempt,
          train=train,
          searcher=searcher,
      )
  
imports: import logging
  import pathlib
  import signal
  import sys
  import threading
  import traceback
  import types
  from typing import Any, Dict, Optional, Union
  import appdirs
  import determined
  from determined import core, tensorboard
  from determined.common import api, constants, storage, util
  from determined.common.api import certs
label_desc: Use image node_id 3 for calling a global function with example usage: _dummy_init() and returns: Context