code: def to_series_list(
      data: Union[
          pd.Series, pd.DataFrame, List[Union[pd.Series, pd.DataFrame]]
      ]
  ) -> List[pd.Series]:
      """Convert the data to a list of series.
  
      Parameters
      ----------
      data : Union[pd.Series, pd.DataFrame, List[Union[pd.Series, pd.DataFrame]]
          Dataframe or Series or list thereof, that should be transformed to a series
          list.
  
      Returns
      -------
      List[pd.Series]
          List of series containing the series present in `data`.
  
      """
      if not isinstance(data, list):
          data = [data]
  
      series_list: List[pd.Series] = []
      for s in data:
          if isinstance(s, pd.DataFrame):
              series_list += [s[c] for c in s.columns]
          elif isinstance(s, pd.Series):
              series_list.append(s)
          else:
              raise TypeError(
                  "Non pd.Series or pd.DataFrame object passed."
              )
  
      return series_list
  
file_path: tsflex/tsflex/utils/data.py
imports: import itertools
  import os
  from pathlib import Path
  from typing import Any, Dict, Iterable, Iterator, List, Tuple, Union
  import numpy
  import pandas
label_desc: Use image node_id 2 for calling a global function with example usage: to_series_list(data) and returns: series_list