code: def temporal_split_evaluator(
      test_data: pd.DataFrame,
      eval_fn: EvalFnType,
      time_col: str,
      time_format: str = "%Y-%m",
      split_values: Iterable[str] = None,
      eval_name: str = None,
  ) -> EvalReturnType:
      """
      Splits the dataset into the temporal categories by `time_col` and evaluate
      model performance in each split.
  
      The splits are implicitly defined by the `time_format`.
      For example, for the default time format ("%Y-%m"), we will split by year and month.
  
      Parameters
      ----------
      test_data : Pandas' DataFrame
          A Pandas' DataFrame with target and predictions.
  
      eval_fn : function DataFrame -> Log Dict
          A partially applied evaluation function.
  
      time_col : string
          The name of the column in `test_data` to split by.
  
      time_format : string
          The way to format the `time_col` into temporal categories.
  
      split_values : Array of string, optional (default=None)
          An array of date formatted strings to split the evaluation by.
          If not provided, all unique formatted dates will be used.
  
      eval_name : String, optional (default=None)
          the name of the evaluator as it will appear in the logs.
  
      Returns
      -------
      log: dict
          A log-like dictionary with evaluation results by split.
      """
  
      formatted_time_col = test_data[time_col].dt.strftime(time_format)
      unique_values = formatted_time_col.unique()
  
      if eval_name is None:
          eval_name = "split_evaluator__" + time_col
  
      if split_values is None:
          split_values = unique_values
      else:
          if not (all(sv in unique_values for sv in split_values)):
              raise ValueError(
                  "All split values must be present in the column (after date formatting it"
              )
  
      return {
          eval_name
          + "_"
          + str(value): eval_fn(
              test_data.loc[lambda df: formatted_time_col == value]
          )
          for value in split_values
      }
  
imports: import warnings
  from typing import Any, Callable, Iterable, List
  import numpy
  import pandas
  import toolz
  from pandas.util import hash_pandas_object
  from sklearn.metrics import average_precision_score, brier_score_loss, fbeta_score, log_loss, mean_absolute_error, mean_squared_error, precision_score, r2_score, recall_score, roc_auc_score
  from toolz import curry, last, first
  from scipy import optimize
  from sklearn.linear_model import LogisticRegression
  from fklearn.types import EvalFnType, EvalReturnType, PredictFnType, UncurriedEvalFnType
label_desc: Use image node_id 20 for calling a global function with example usage: temporal_split_evaluator(test_data, eval_fn, time_col, time_format, split_values, eval_name) and returns: unknown