def _load_dataset(name, archive, return_X_y):
    r"""Load and return dataset.

    Parameters
    ----------
    name : str
        Name of the dataset.

    archive : 'UCR' or 'UEA'
        Archive the dataset belongs to.

    return_X_y : bool
        If True, return
        ``(data_train, data_test, target_train, target_test)`` instead of a
        Bunch object.

    Returns
    -------
    data : Bunch
        Dictionary-like object, with attributes:

        data_train : array of floats
            The time series in the training set.
        data_test : array of floats
            The time series in the test set.
        target_train : array of integers
            The classification labels in the training set.
        target_test : array of integers
            The classification labels in the test set.
        DESCR : str
            The full description of the dataset.
        url : str
            The url of the dataset.

    (data_train, data_test, target_train, target_test) : tuple if ``return_X_y`` is True

    """  # noqa: E501
    module_path = os.path.dirname(__file__)
    folder = os.path.join(module_path, 'cached_datasets', archive, '')
    if archive == 'UCR':
        bunch = _load_ucr_dataset(name, folder)
    else:
        bunch = _load_uea_dataset(name, folder)
    if return_X_y:
        return (bunch.data_train, bunch.data_test,
                bunch.target_train, bunch.target_test)
    return bunch
Load and return dataset.

    Parameters
    ----------
    name : str
        Name of the dataset.

    archive : 'UCR' or 'UEA'
        Archive the dataset belongs to.

    return_X_y : bool
        If True, return
        ``(data_train, data_test, target_train, target_test)`` instead of a
        Bunch object.

    Returns
    -------
    data : Bunch
        Dictionary-like object, with attributes:

        data_train : array of floats
            The time series in the training set.
        data_test : array of floats
            The time series in the test set.
        target_train : array of integers
            The classification labels in the training set.
        target_test : array of integers
            The classification labels in the test set.
        DESCR : str
            The full description of the dataset.
        url : str
            The url of the dataset.

    (data_train, data_test, target_train, target_test) : tuple if ``return_X_y`` is True

    
pyts/datasets/load.py