class_docstr: Class that executes a specific operation on the passed series_dict.
  
  Parameters
  ----------
  function : Callable
      The function that processes the series (given in the `series_names`).
      The prototype of the function should match: 
  
  
          function(*series: pd.Series, **kwargs)
              -> Union[np.ndarray, pd.Series, pd.DataFrame, List[pd.Series]]
  
      .. note::
          A function that processes a ``np.ndarray`` instead of ``pd.Series``
          should work just fine.
  
  series_names : Union[str, Tuple[str, ...], List[str], List[Tuple[str, ...]]]
      The names of the series on which the processing function should be applied.
  
      This argument should match the `function` its input; 
  
      * If `series_names` is a (list of) string (or tuple of a single string),
        than `function` should require just one series as input.
      * If `series_names` is a (list of) tuple of strings, than `function` should
        require `len(tuple)` series as input **and in exactly the same order**.
  
      A list means multiple series (combinations) to process; 
  
      * If `series_names` is a string or a tuple of strings, than `function` will
        be called only once for the series of this argument.
      * If `series_names` is a list of either strings or tuple of strings, than
        `function` will be called for each entry of this list.
  
      .. note::
          when passing a list as `series_names`, all items in this list should
          have the same type, i.e, either 
  
          * all a `str`
          * or, all a `tuple` _with same length_. 
  
  
  **kwargs: dict, optional
      Keyword arguments which will be also passed to the `function`
  
  Notes
  -----
  If the output of `function` is a `np.ndarray` or a `pd.Series` without a name,
  than (items of) the given `series_names` must have length 1, i.e., the function
  requires just 1 series! That series its name and index are used to transform
  (i.e., **replace**) that series.
  
  If you want to transform (i.e., **replace**) the input series with the
  processor, than `function` should return either: 
  
  * a `np.ndarray` (see above).
  * a `pd.Series` with no name or with the same name as the input series.
  * a `pd.DataFrame` with (one) column name equal to the input series its name.
  * a list of `pd.Series` in which (exact) one series has the same name as the
    input series.
  
  Series (& columns) with other (column) names will be added to the series dict.
class_docstr_tok: ["Class","that","executes","a","specific","operation","on","the","passed","series_dict",".","Parameters","--","--","--","--","--","function",":","Callable","The","function","that","processes","the","series","(","given","in","the","`","series_names","`",")",".","The","prototype","of","the","function","should","match",":","function","(","*","series",":","pd.Series",",","*","*","kwargs",")","-",">","Union","[","np.ndarray",",","pd.Series",",","pd.DataFrame",",","List","[","pd.Series","]","]","..","note",":",":","A","function","that","processes","a","``","np.ndarray","``","instead","of","``","pd.Series","``","should","work","just","fine",".","series_names",":","Union","[","str",",","Tuple","[","str",",","...","]",",","List","[","str","]",",","List","[","Tuple","[","str",",","...","]","]","]","The","names","of","the","series","on","which","the","processing","function","should","be","applied",".","This","argument","should","match","the","`","function","`","its","input",";","*","If","`","series_names","`","is","a","(","list","of",")","string","(","or","tuple","of","a","single","string",")",",","than","`","function","`","should","require","just","one","series","as","input",".","*","If","`","series_names","`","is","a","(","list","of",")","tuple","of","strings",",","than","`","function","`","should","require","`","len","(","tuple",")","`","series","as","input","*","*","and","in","exactly","the","same","order","*","*",".","A","list","means","multiple","series","(","combinations",")","to","process",";","*","If","`","series_names","`","is","a","string","or","a","tuple","of","strings",",","than","`","function","`","will","be","called","only","once","for","the","series","of","this","argument",".","*","If","`","series_names","`","is","a","list","of","either","strings","or","tuple","of","strings",",","than","`","function","`","will","be","called","for","each","entry","of","this","list",".","..","note",":",":","when","passing","a","list","as","`","series_names","`",",","all","items","in","this","list","should","have","the","same","type",",","i.e",",","either","*","all","a","`","str","`","*","or",",","all","a","`","tuple","`","_with","same","length_",".","*","*","kwargs",":","dict",",","optional","Keyword","arguments","which","will","be","also","passed","to","the","`","function","`","Notes","--","--","-","If","the","output","of","`","function","`","is","a","`","np.ndarray","`","or","a","`","pd.Series","`","without","a","name",",","than","(","items","of",")","the","given","`","series_names","`","must","have","length","1",",","i.e.",",","the","function","requires","just","1","series","!","That","series","its","name","and","index","are","used","to","transform","(","i.e.",",","*","*","replace","*","*",")","that","series",".","If","you","want","to","transform","(","i.e.",",","*","*","replace","*","*",")","the","input","series","with","the","processor",",","than","`","function","`","should","return","either",":","*","a","`","np.ndarray","`","(","see","above",")",".","*","a","`","pd.Series","`","with","no","name","or","with","the","same","name","as","the","input","series",".","*","a","`","pd.DataFrame","`","with","(","one",")","column","name","equal","to","the","input","series","its","name",".","*","a","list","of","`","pd.Series","`","in","which","(","exact",")","one","series","has","the","same","name","as","the","input","series",".","Series","(","&","columns",")","with","other","(","column",")","names","will","be","added","to","the","series","dict","."]
docstr: **Call**culates the processed series.
  
  Parameters
  ----------
  series_dict : Dict[str, pd.Series]
      A dict of `pd.Series` containing the data that need to be processed.
      The key should always be the accompanying series its name.
  
  Returns
  -------
  Dict[str, pd.Series]
      The processed `series_dict`.
  
  Raises
  ------
  KeyError
      Raised when a key is not present in the `series_dict` but required for the
      processing.
  TypeError
      Raised when the output of the `SeriesProcessor` is not of the correct type.
  
  Notes
  -----
  * The `series_dict` is an internal representation of the time-series data .
    This internal representation is constructed in the `process` method of the
    `SeriesPipeline`.
  * If you want to test or debug your `SeriesProcessor` object, just encapsulate
    your instance of this class in a `SeriesPipeline`. The latter allows more
    versatile input for its `process` method.
docstr_tok: ["*","*","Call","*","*","culates","the","processed","series",".","Parameters","--","--","--","--","--","series_dict",":","Dict","[","str",",","pd.Series","]","A","dict","of","`","pd.Series","`","containing","the","data","that","need","to","be","processed",".","The","key","should","always","be","the","accompanying","series","its","name",".","Returns","--","--","--","-","Dict","[","str",",","pd.Series","]","The","processed","`","series_dict","`",".","Raises","--","--","--","KeyError","Raised","when","a","key","is","not","present","in","the","`","series_dict","`","but","required","for","the","processing",".","TypeError","Raised","when","the","output","of","the","`","SeriesProcessor","`","is","not","of","the","correct","type",".","Notes","--","--","-","*","The","`","series_dict","`","is","an","internal","representation","of","the","time-series","data",".","This","internal","representation","is","constructed","in","the","`","process","`","method","of","the","`","SeriesPipeline","`",".","*","If","you","want","to","test","or","debug","your","`","SeriesProcessor","`","object",",","just","encapsulate","your","instance","of","this","class","in","a","`","SeriesPipeline","`",".","The","latter","allows","more","versatile","input","for","its","`","process","`","method","."]
code: def __call__(
      self, series_dict: Dict[str, pd.Series]
  ) -> Dict[str, pd.Series]:
      """**Call**culates the processed series.
  
      Parameters
      ----------
      series_dict : Dict[str, pd.Series]
          A dict of `pd.Series` containing the data that need to be processed.
          The key should always be the accompanying series its name.
  
      Returns
      -------
      Dict[str, pd.Series]
          The processed `series_dict`.
  
      Raises
      ------
      KeyError
          Raised when a key is not present in the `series_dict` but required for the
          processing.
      TypeError
          Raised when the output of the `SeriesProcessor` is not of the correct type.
  
      Notes
      -----
      * The `series_dict` is an internal representation of the time-series data .
        This internal representation is constructed in the `process` method of the
        `SeriesPipeline`.
      * If you want to test or debug your `SeriesProcessor` object, just encapsulate
        your instance of this class in a `SeriesPipeline`. The latter allows more
        versatile input for its `process` method.
  
      """
      t_start = time.perf_counter()
  
      # Only selecting the series that are needed for this processing step
      # requested_dict = {}
      # try:
      #     for sig in self.get_required_series():
      #         requested_dict[sig] = series_dict[sig]
      # except KeyError as key:
      #     # Re raise error as we can't continue
      #     raise KeyError(
      #         "Key %s is not present in the input dict and needed for processor %s"
      #         % (key, self.name)
      #     )
  
      # Variable that will contain the final output of this method
      processed_output: Dict[str, pd.Series] = {}
  
      def get_series_list(keys: Tuple[str, ...]):
          """Get an ordered series list view for the given keys."""
          return [series_dict[key] for key in keys]
  
      def get_series_dict(keys: Tuple[str, ...]):
          """Get a series dict view for the given keys."""
          return {key: series_dict[key] for key in keys}
  
      for series_name_tuple in self.series_names:
          func_output = self.function(
              *get_series_list(series_name_tuple), **self.kwargs
          )
          func_output = _handle_seriesprocessor_func_output(
              func_output,
              get_series_dict(series_name_tuple),
              self.name,
          )
          # Check that the output of the function call produces unique columns / keys
          assert (
              len(
                  set(processed_output.keys()).intersection(
                      func_output.keys()
                  )
              )
              == 0
          )
          processed_output.update(func_output)
  
      elapsed = time.perf_counter() - t_start
      logger.info(
          f"Finished function [{self.name}] on {self.series_names} with output "
          f"{list(processed_output.keys())} in [{elapsed} seconds]!"
      )
  
      return processed_output
  
file_path: tsflex/tsflex/processing/series_processor.py
imports: import time
  from typing import Callable, Dict, List, Tuple, Union
  import numpy
  import pandas
  from ..None import __pdoc__
  from ..utils.classes import FrozenClass
  from ..utils.data import flatten, series_dict_to_df, to_list, to_tuple
  from .logger import logger
label_desc: Use image node_id 3 for calling the SeriesProcessor obj's underlying member method code with example usage: obj.__call__(series_dict) and returns: processed_output, unknown, unknown