docstr: Adds new cache entry.
docstr_tok: ["Adds","new","cache","entry","."]
code: def put(self, key: str, value: bytes):
      """Adds new cache entry."""
      if not key:
          raise ValueError("key cannot be empty")
      path_to_new_file = self._path / key
      if str(path_to_new_file).startswith("gs://"):
          # Writes to gcs are atomic.
          path_to_new_file.write_bytes(value)
      elif str(path_to_new_file).startswith(
          "file://"
      ) or "://" not in str(path_to_new_file):
          tmp_path = self._path / f"_temp_{key}"
          with open(str(tmp_path), "wb") as f:
              f.write(value)
              f.flush()
              os.fsync(f.fileno())
          os.replace(tmp_path, path_to_new_file)
      else:
          tmp_path = self._path / f"_temp_{key}"
          tmp_path.write_bytes(value)
          tmp_path.replace(str(path_to_new_file))
  
file_path: jax/jax/_src/gfile_cache.py
imports: import os
  from jax._src import path
  from jax._src.compilation_cache_interface import CacheInterface
label_desc: Use image node_id 3 for calling the GFileCache obj's underlying member method code with example usage: obj.put(key, value) without return types