code: def _download_and_extract(url, extract_path=None):
      """Download and unzip datasets (helper function).
  
      This code was modified from
      https://github.com/tslearn-team/tslearn/blob
      /775daddb476b4ab02268a6751da417b8f0711140/tslearn/datasets.py#L28
  
      Parameters
      ----------
      url : string
          Url pointing to file to download
      extract_path : string, optional (default: None)
          path to extract downloaded zip to, None defaults
          to sktime/datasets/data
  
      Returns
      -------
      extract_path : string or None
          if successful, string containing the path of the extracted file, None
          if it wasn't successful
      """
      file_name = os.path.basename(url)
      dl_dir = tempfile.mkdtemp()
      zip_file_name = os.path.join(dl_dir, file_name)
      urlretrieve(url, zip_file_name)
  
      if extract_path is None:
          extract_path = os.path.join(
              MODULE, "local_data/%s/" % file_name.split(".")[0]
          )
      else:
          extract_path = os.path.join(
              extract_path, "%s/" % file_name.split(".")[0]
          )
  
      try:
          if not os.path.exists(extract_path):
              os.makedirs(extract_path)
          zipfile.ZipFile(zip_file_name, "r").extractall(extract_path)
          shutil.rmtree(dl_dir)
          return extract_path
      except zipfile.BadZipFile:
          shutil.rmtree(dl_dir)
          if os.path.exists(extract_path):
              shutil.rmtree(extract_path)
          raise zipfile.BadZipFile(
              "Could not unzip dataset. Please make sure the URL is valid."
          )
  
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 1 for calling a global function with example usage: _download_and_extract(url, extract_path) and returns: extract_path