code: def load_and_cache_dataset(name):
      """Loads the dataset with the given name and caches it.
  
      This method is a wrapper around :func:`fiftyone.core.dataset.load_dataset`
      that stores a reference to every dataset it loads in a TTL cache to ensure
      that references to recently used datasets exist in memory so that dataset
      objects aren't garbage collected between async calls.
  
      It is desirable to avoid dataset objects being garbage collected because
      datasets are singletons and may have objects (eg brain results) that are
      expensive to load cached on them.
  
      Args:
          name: the dataset name
  
      Returns:
          a :class:`fiftyone.core.dataset.Dataset`
      """
      dataset = fod.load_dataset(name)
  
      # Store reference in TTL cache to defer garbage collection
      # IMPORTANT: we don't return already cached objects here because a dataset
      # can be deleted and another created with the same name
      _cache[name] = dataset
  
      return dataset
  
file_path: fiftyone/fiftyone/server/utils.py
imports: import typing
  import cachetools
  from dacite import Config, from_dict
  from dacite.core import T
  from dacite.data import Data
  import fiftyone.core.collections
  import fiftyone.core.dataset
  import fiftyone.core.fields
  import fiftyone.core.labels
  import fiftyone.core.media
label_desc: Use image node_id 1 for calling a global function with example usage: load_and_cache_dataset(name) and returns: dataset