class_docstr: Cache the distillation labels in memory.
class_docstr_tok: ["Cache","the","distillation","labels","in","memory","."]
code: def save_checkpoint(self, checkpoint_folder: str | PathLike):
      root_path = Path(checkpoint_folder).absolute()
      root_path.mkdir(parents=True, exist_ok=True)
      uid2filename = {}
      for uid, data in self._uid2data.items():
          uid2filename[uid] = f"{uid}.pkl"
          pickle_dump(data, root_path / "data" / uid2filename[uid])
      with Path(root_path / SETTING_FILENAME).open(mode="w") as f:
          json_tricks.dump(uid2filename, f, indent=4)
  
imports: from __future__ import annotations
  import logging
  import os
  from os import PathLike
  from pathlib import Path
  import shutil
  import tempfile
  from typing import Any, Dict, List, Literal
  import json_tricks
  from .utils import pickle_dump, pickle_load
label_desc: Use image node_id 6 for calling the MemoryStorage obj's underlying member method code with example usage: obj.save_checkpoint(checkpoint_folder) without return types