code: def init_context(
      *,
      defaults: Optional[DefaultConfig] = None,
      unmanaged: Optional[UnmanagedConfig] = None,
      client: Optional[experimental.Determined] = None,
      distributed: Optional[core.DistributedContext] = None,
      checkpoint_storage: Optional[Union[str, Dict[str, Any]]] = None,
      preempt_mode: core.PreemptMode = core.PreemptMode.WorkersAskChief,
      tensorboard_mode: core.TensorboardMode = core.TensorboardMode.AUTO,
  ) -> core.Context:
      """
      Core V2 initializer in the context-manager style.
      """
      if client is None:
          client = experimental.Determined()
  
      _context = _init_context(
          defaults=defaults,
          unmanaged=unmanaged,
          client=client,
          distributed=distributed,
          checkpoint_storage=checkpoint_storage,
          preempt_mode=preempt_mode,
          tensorboard_mode=tensorboard_mode,
      )
  
      return _context
  
file_path: determined/harness/determined/experimental/core_v2/_core_v2.py
imports: import atexit
  import dataclasses
  import logging
  import uuid
  from typing import Any, Dict, List, Optional, Union
  import determined
  from determined import core, experimental
  from determined.common import util
  from determined.experimental import core_v2
label_desc: Use image node_id 3 for calling a global function with example usage: init_context() and returns: _context