def load_dataset(name, create_if_necessary=False):
    """Loads the FiftyOne dataset with the given name.

    To create a new dataset, use the :class:`Dataset` constructor.

    .. note::

        :class:`Dataset` instances are singletons keyed by their name, so all
        calls to this method with a given dataset ``name`` in a program will
        return the same object.

    Args:
        name: the name of the dataset
        create_if_necessary (False): if no dataset exists, create an empty one

    Raises:
        DatasetNotFoundError: if the dataset does not exist and
            `create_if_necessary` is False

    Returns:
        a :class:`Dataset`
    """
    try:
        return Dataset(name, _create=False)
    except DatasetNotFoundError as ex:
        if create_if_necessary:
            return Dataset(name, _create=True)
        else:
            raise ex
Loads the FiftyOne dataset with the given name.

    To create a new dataset, use the :class:`Dataset` constructor.

    .. note::

        :class:`Dataset` instances are singletons keyed by their name, so all
        calls to this method with a given dataset ``name`` in a program will
        return the same object.

    Args:
        name: the name of the dataset
        create_if_necessary (False): if no dataset exists, create an empty one

    Raises:
        DatasetNotFoundError: if the dataset does not exist and
            `create_if_necessary` is False

    Returns:
        a :class:`Dataset`
    
fiftyone/core/dataset.py