code: def _check_summary_function(summary_function):
      """Validate summary_function.
  
      Parameters
      ----------
      summary_function : str, list or tuple
          Either a string or list/tuple of strings indicating the pandas summary
          functions ("mean", "min", "max", "median", "sum", "skew", "kurtosis",
          "var", "std", "mad", "sem", "nunique", "count") that is used to summarize
          each column of the dataset.
  
      Returns
      -------
      summary_function : list or tuple
          The summary functions that will be used to summarize the dataset.
      """
      msg = f"""`summary_function` must be None, or str or a list or tuple made up of
            {ALLOWED_SUM_FUNCS}.
            """
      if isinstance(summary_function, str):
          if summary_function not in ALLOWED_SUM_FUNCS:
              raise ValueError(msg)
          summary_function = [summary_function]
      elif isinstance(summary_function, (list, tuple)):
          if not all(
              [func in ALLOWED_SUM_FUNCS for func in summary_function]
          ):
              raise ValueError(msg)
      elif summary_function is not None:
          raise ValueError(msg)
      return summary_function
  
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 3 for calling a global function with example usage: _check_summary_function(summary_function) and returns: summary_function