class_docstr: ``CheckpointContext`` gives access to checkpoint-related features of a Determined cluster.
class_docstr_tok: ["``","CheckpointContext","``","gives","access","to","checkpoint-related","features","of","a","Determined","cluster","."]
code: def __init__(
      self,
      dist: core.DistributedContext,
      storage_manager: storage.StorageManager,
      session: api.Session,
      task_id: str,
      allocation_id: Optional[str],
      tbd_sync_mode: core.TensorboardMode,
      tensorboard_manager: Optional[tensorboard.TensorboardManager],
  ) -> None:
      self._dist = dist
      self._storage_manager = storage_manager
      self._session = session
      self._task_id = task_id
      self._allocation_id = allocation_id
      self._tensorboard_mode = tbd_sync_mode
      if (
          tbd_sync_mode != core.TensorboardMode.MANUAL
          and tensorboard_manager is None
      ):
          raise ValueError(
              "either set TensorboardMode.MANUAL, or pass a tensorboard manager."
          )
      self._tensorboard_manager = tensorboard_manager
  
imports: import contextlib
  import datetime
  import enum
  import hashlib
  import json
  import logging
  import os
  import pathlib
  import uuid
  from typing import Any, Callable, Dict, Iterator, List, Optional, Set, Tuple, Union
  from determined import core, tensorboard
  from determined.common import api, storage
  from determined.common.api import bindings
label_desc: Use image node_id 1 to create a new CheckpointContext object  with example: obj = CheckpointContext(dist, storage_manager, session, task_id, allocation_id, tbd_sync_mode, tensorboard_manager)