code: def init(
      *,
      defaults: Optional[DefaultConfig] = None,
      unmanaged: Optional[UnmanagedConfig] = None,
      client: Optional[experimental.Determined] = None,
      # Classic core context arguments.
      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,
      # resume: bool = True  # TODO(ilia): optionally control resume behaviour.
  ) -> None:
      """
      Core V2 initializer in the singleton style.
      """
      global _context
      global _client
      global _atexit_registered
  
      if _context is not None:
          _context.close()
  
      if client is None:
          client = experimental.Determined()
      _client = client
  
      _context = _init_context(
          defaults=defaults,
          unmanaged=unmanaged,
          client=client,
          distributed=distributed,
          checkpoint_storage=checkpoint_storage,
          preempt_mode=preempt_mode,
          tensorboard_mode=tensorboard_mode,
      )
      _context.start()
      _set_globals()
  
      if not _atexit_registered:
          atexit.register(close)
          _atexit_registered = True
  
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 4 for calling a global function with example usage: init() without return types