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
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`
    
fiftyone/server/utils.py