code: def make_datasets(path, dataset_cls, names=None, **kwargs):
      """Make datasets."""
      # check dataset class
      # if not isinstance(dataset_cls, BaseDataset):
      #     raise ValueError(f"dataset must inherit from BaseDataset, but found:"
      #                      f"{type(dataset_cls)}")
  
      # check dataset names
      if names is not None:
          if not isinstance(names, list):
              raise ValueError(
                  f"names must be a list, but found: {type(names)}"
              )
      else:
          names = os.listdir(
              path
          )  # get names if names is not specified
  
      # generate datasets
      datasets = [
          dataset_cls(path=path, name=name, **kwargs) for name in names
      ]
      return datasets
  
file_path: sktime/sktime/benchmarking/data.py
imports: import os
  import pandas
  from sktime.benchmarking.base import BaseDataset, HDDBaseDataset
  from sktime.datasets import load_from_tsfile_to_dataframe
label_desc: Use image node_id 1 for calling a global function with example usage: make_datasets(path, dataset_cls, names) and returns: datasets