code: def _cache_save(path: Path, value: Any, file_type: str):
      if file_type == "json":
          with open(str(path), "w") as f:
              json.dump(value, f)
      elif file_type == "pickle":
          with open(str(path), "wb") as f:
              pickle.dump(value, f)
      else:
          raise ValueError(f"Unknown file type: {file_type}")
  
file_path: labml/client/labml/utils/cache.py
imports: import functools
  import json
  import pickle
  from pathlib import Path
  from typing import Callable, Any, Optional
  from labml import lab
label_desc: Use image node_id 2 for calling a global function with example usage: _cache_save(path, value, file_type) without return types