class_docstr: Package index.
  
  Package index is a `Dict[DatasetName, DatasetPackage]` loaded from cache.
  It has an additional `.refresh()` method to update the local cache by
  querying the remote index (stored in `gs://tfds-data`).
  
  On disk, the package index is a simple list of datasets with their
  associated source:
  
  ```jsonl
  {"name": "kaggle:ds0", "source": "github://..."}
  {"name": "kaggle:ds1", "source": "github://..."}
  {"name": "tensorflow_graphics:shapenet", "source": "github://..."}
  [...]
  ```
class_docstr_tok: ["Package","index",".","Package","index","is","a","`","Dict","[","DatasetName",",","DatasetPackage","]","`","loaded","from","cache",".","It","has","an","additional","`",".refresh","(",")","`","method","to","update","the","local","cache","by","querying","the","remote","index","(","stored","in","`","gs",":","\/\/tfds-data","`",")",".","On","disk",",","the","package","index","is","a","simple","list","of","datasets","with","their","associated","source",":","``","`","jsonl","{","``","name","''",":","``","kaggle",":","ds0","''",",","``","source","''",":","``","github",":","\/\/","...","''","}","{","``","name","''",":","``","kaggle",":","ds1","''",",","``","source","''",":","``","github",":","\/\/","...","''","}","{","``","name","''",":","``","tensorflow_graphics",":","shapenet","''",",","``","source","''",":","``","github",":","\/\/","...","''","}","[","...","]","``","`"]
docstr: Update the cache.
docstr_tok: ["Update","the","cache","."]
code: def refresh(self) -> None:
      """Update the cache."""
      # Should have a timer to avoid refreshing the cache immediatelly
      # (and a force=True option to ignore this)
      # e.g. with os.path.getmtime(cached_path) - time.gmtime()
  
      try:
          content = self._remote_path.read_text()
      except gcs_utils.gcs_unavailable_exceptions() as e:
          # Do not crash if GCS access not available, but instead silently reuse
          # the cache.
          logging.info(
              "Could not refresh the package index (GCS unavailable): %s",
              e,
          )
          return
  
      # If read was sucessful, update the cache with the new dataset list
      self._cached_path.write_text(
          content
      )  # pytype: disable=attribute-error  # attribute-variable-annotations
      self._refresh_from_content(content)
  
imports: import collections
  import dataclasses
  import datetime
  import functools
  import hashlib
  import json
  import tempfile
  from typing import Any, Iterator, List, Optional, Type
  from absl import logging
  from etils import epath
  from tensorflow_datasets.core import dataset_builder
  from tensorflow_datasets.core import naming
  from tensorflow_datasets.core import registered
  from tensorflow_datasets.core import utils
  from tensorflow_datasets.core.community import cache
  from tensorflow_datasets.core.community import dataset_sources
  from tensorflow_datasets.core.community import load
  from tensorflow_datasets.core.community import register_base
  from tensorflow_datasets.core.download import checksums
  from tensorflow_datasets.core.utils import gcs_utils
label_desc: Use image node_id 3 for calling the _PackageIndex obj's underlying member method code with example usage: obj.refresh() without return types