code: def _load_provided_dataset(
      name,
      split=None,
      return_X_y=True,
      return_type=None,
      extract_path=None,
  ):
      """Load baked in time series classification datasets (helper function).
  
      Loads data from the provided files from sktime/datasets/data only.
  
      Parameters
      ----------
      name : string, file name to load from
      split: None or one of "TRAIN", "TEST", optional (default=None)
          Whether to load the train or test instances of the problem.
          By default it loads both train and test instances (in a single container).
      return_X_y: bool, optional (default=True)
          If True, returns (features, target) separately instead of a single
          dataframe with columns for features and the target.
      return_type: valid Panel mtype str or None, optional (default=None="nested_univ")
          Memory data format specification to return X in, None = "nested_univ" type.
          str can be any supported sktime Panel mtype,
              for list of mtypes, see datatypes.MTYPE_REGISTER
              for specifications, see examples/AA_datatypes_and_datasets.ipynb
          commonly used specifications:
              "nested_univ: nested pd.DataFrame, pd.Series in cells
              "numpy3D"/"numpy3d"/"np3D": 3D np.ndarray (instance, variable, time index)
              "numpy2d"/"np2d"/"numpyflat": 2D np.ndarray (instance, time index)
              "pd-multiindex": pd.DataFrame with 2-level (instance, time) MultiIndex
          Exception is raised if the data cannot be stored in the requested type.
      extract_path: default = join(MODULE, DIRNAME) = os.path.dirname(__file__) + "/data"
          path to extract downloaded zip to
  
      Returns
      -------
      X: sktime data container, following mtype specification `return_type`
          The time series data for the problem, with n instances
      y: 1D numpy array of length n, only returned if return_X_y if True
          The class labels for each time series instance in X
          If return_X_y is False, y is appended to X instead.
      """
      if extract_path is None:
          extract_path = os.path.join(MODULE, DIRNAME)
  
      if isinstance(split, str):
          split = split.upper()
  
      if split in ("TRAIN", "TEST"):
          fname = name + "_" + split + ".ts"
          abspath = os.path.join(extract_path, name, fname)
          X, y = load_from_tsfile(
              abspath, return_data_type="nested_univ"
          )
      # if split is None, load both train and test set
      elif split is None:
          fname = name + "_TRAIN.ts"
          abspath = os.path.join(extract_path, name, fname)
          X_train, y_train = load_from_tsfile(
              abspath, return_data_type="nested_univ"
          )
  
          fname = name + "_TEST.ts"
          abspath = os.path.join(extract_path, name, fname)
          X_test, y_test = load_from_tsfile(
              abspath, return_data_type="nested_univ"
          )
  
          X = pd.concat([X_train, X_test])
          X = X.reset_index(drop=True)
          y = np.concatenate([y_train, y_test])
  
      else:
          raise ValueError("Invalid `split` value =", split)
  
      return_type = _alias_mtype_check(return_type)
      if return_X_y:
          X = convert(X, from_type="nested_univ", to_type=return_type)
          return X, y
      else:
          X["class_val"] = pd.Series(y)
          X = convert(X, from_type="nested_univ", to_type=return_type)
          return X
  
file_path: sktime/sktime/datasets/_data_io.py
imports: import os
  import shutil
  import tempfile
  import zipfile
  from urllib.request import urlretrieve
  import numpy
  import pandas
  from sktime.datasets._readers_writers.ts import load_from_tsfile
  from sktime.datasets._readers_writers.utils import _alias_mtype_check
  from sktime.datatypes import convert
  from sktime.datatypes._panel._convert import _make_column_names
label_desc: Use image node_id 6 for calling a global function with example usage: _load_provided_dataset(name, split, return_X_y, return_type, extract_path) and returns: X,  y, X