code: def get_name_list(Z):
      """Get names of pd.Series or pd.Dataframe."""
      if isinstance(Z, pd.DataFrame):
          Z_name = Z.columns.to_list()
      else:
          if Z.name is not None:
              Z_name = [Z.name]
          else:
              Z_name = None
      Z_name = [str(z) for z in Z_name]
      return Z_name
  
imports: import pandas
  from joblib import Parallel, delayed
  from sktime.split import ExpandingWindowSplitter, SlidingWindowSplitter
  from sktime.transformations.base import BaseTransformer
  from sktime.utils.multiindex import flatten_multiindex
label_desc: Use image node_id 1 for calling a global function with example usage: get_name_list(Z) and returns: Z_name