code: def fetch_uea_dataset(
      dataset, use_cache=True, data_home=None, return_X_y=False
  ):  # noqa 207
      """Fetch dataset from UEA TSC Archive by name.
  
      Fetched data sets are saved by default in the
      ``pyts/datasets/cached_datasets/UEA/`` folder. To avoid
      downloading the same data set several times, it is
      highly recommended not to change the default values
      of ``use_cache`` and ``path``.
  
      Parameters
      ----------
      dataset : str
          Name of the dataset.
  
      use_cache : bool (default = True)
          If True, look if the data set has already been fetched
          and load the fetched version if it is the case. If False,
          download the data set from the UCR Time Series Classification
          Archive.
  
      data_home : None or str (default = None)
          The path of the folder containing the cached data set.
          If None, the ``pyts.datasets.cached_datasets/UEA/`` folder is
          used. If the data set is not found, it is downloaded and cached
          in this path.
  
      return_X_y : bool (default = False)
          If True, returns ``(data_train, data_test, target_train, target_test)``
          instead of a Bunch object. See below for more information about the
          `data` and `target` 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
  
      Notes
      -----
      Missing values are represented as NaN's.
  
      References
      ----------
      .. [1] A. Bagnall et al, "The UEA multivariate time series
             classification archive, 2018". arXiv:1811.00075 [cs, stat],
             2018.
  
      .. [2] A. Bagnall et al, "The UEA & UCR Time Series Classification
             Repository", www.timeseriesclassification.com.
  
      """
      if dataset not in uea_dataset_list():
          raise ValueError(
              "{0} is not a valid name. The list of available names "
              "can be obtained with ``pyts.datasets.uea_dataset_list()``".format(
                  dataset
              )
          )
      if data_home is None:
          import pyts
  
          home = os.sep.join(pyts.__file__.split(os.sep)[:-2])
          path = os.path.join(
              home, "pyts", "datasets", "cached_datasets", "UEA"
          )
      else:
          path = data_home
      if not os.path.exists(path):
          os.makedirs(path)
  
      correct_dataset = _correct_uea_name_download(dataset)
      if use_cache and os.path.exists(
          os.path.join(path, correct_dataset)
      ):
          bunch = _load_uea_dataset(correct_dataset, path)
      else:
          url = (
              "http://www.timeseriesclassification.com/"
              "ClassificationDownloads/{0}.zip".format(correct_dataset)
          )
          filename = "temp_{}".format(correct_dataset)
          _ = urlretrieve(url, os.path.join(path, filename))
          zipfile.ZipFile(os.path.join(path, filename)).extractall(
              os.path.join(path, correct_dataset)
          )
          os.remove(os.path.join(path, filename))
          bunch = _load_uea_dataset(correct_dataset, path)
  
      if return_X_y:
          return (
              bunch.data_train,
              bunch.data_test,
              bunch.target_train,
              bunch.target_test,
          )
      return bunch
  
file_path: pyts/pyts/datasets/uea.py
imports: import numpy
  import os
  import pickle
  from scipy.io.arff import loadarff
  from sklearn.utils import Bunch
  from urllib.request import urlretrieve
  import zipfile
label_desc: Use image node_id 4 for calling a global function with example usage: fetch_uea_dataset(dataset, use_cache, data_home, return_X_y) and returns: bunch, bunch,  bunch,  bunch,  bunch