code: def parallel_validator(
      train_data: pd.DataFrame,
      split_fn: SplitterFnType,
      train_fn: LearnerFnType,
      eval_fn: EvalFnType,
      n_jobs: int = 1,
      predict_oof: bool = False,
      return_eval_logs_on_train: bool = False,
      verbose: bool = False,
  ) -> ValidatorReturnType:
      """
      Splits the training data into folds given by the split function and
      performs a train-evaluation sequence on each fold. Tries to run each
      fold in parallel using up to n_jobs processes.
  
      Parameters
      ----------
      train_data : pandas.DataFrame
          A Pandas' DataFrame with training data
  
      split_fn : function pandas.DataFrame ->  list of tuple
          Partially defined split function that takes a dataset and returns
          a list of folds. Each fold is a Tuple of arrays. The fist array in
          each tuple contains training indexes while the second array
          contains validation indexes.
  
      train_fn : function pandas.DataFrame -> prediction_function, predictions_dataset, logs
          A partially defined learning function that takes a training set and
          returns a predict function, a dataset with training predictions and training
          logs.
  
      eval_fn : function pandas.DataFrame -> dict
          A partially defined evaluation function that takes a dataset with prediction and
          returns the evaluation logs.
  
      n_jobs : int
          Number of parallel processes to spawn.
  
      predict_oof : bool
          Whether to return out of fold predictions on the logs
  
      return_eval_logs_on_train : bool
          Whether to apply eval_fn to the training set of each split and return the resulting logs in the train logs
  
      verbose: bool
          Whether to show more information about the cross validation or not
  
      Returns
      ----------
      A list log-like dictionary evaluations.
      """
      folds, logs = split_fn(train_data)
  
      result = Parallel(n_jobs=n_jobs, backend="threading")(
          delayed(parallel_validator_iteration)(
              train_data,
              x,
              train_fn,
              eval_fn,
              predict_oof,
              return_eval_logs_on_train,
              verbose,
          )
          for x in enumerate(folds)
      )
      gc.collect()
  
      train_log = {
          "train_log": [
              fold_result["train_log"] for fold_result in result
          ]
      }
  
      @curry
      def kwdissoc(d: Dict, key: str) -> Dict:
          return dissoc(d, key)
  
      validator_logs = pipe(
          result,
          partial(zip, logs),
          map(
              lambda log_tuple: assoc(
                  log_tuple[1], "split_log", log_tuple[0]
              )
          ),
          map(kwdissoc(key="train_log")),
          list,
      )
  
      return assoc(train_log, "validator_log", validator_logs)
  
file_path: fklearn/src/fklearn/validation/validator.py
imports: import gc
  import inspect
  import warnings
  from typing import Dict, Tuple, List
  import pandas
  from joblib import Parallel, delayed
  from toolz import compose
  from toolz.curried import assoc, curry, dissoc, first, map, partial, pipe
  from toolz.functoolz import identity
  from tqdm import tqdm
  from fklearn.types import EvalFnType, LearnerFnType, LogType
  from fklearn.types import SplitterFnType, ValidatorReturnType, PerturbFnType
label_desc: Use image node_id 4 for calling a global function with example usage: parallel_validator(train_data, split_fn, train_fn, eval_fn, n_jobs, predict_oof, return_eval_logs_on_train, verbose) and returns: assoc, dissoc