code: def custom_transformer(
      df: pd.DataFrame,
      columns_to_transform: List[str],
      transformation_function: Callable[[pd.DataFrame], pd.DataFrame],
      is_vectorized: bool = False,
  ) -> LearnerReturnType:
      """
      Applies a custom function to the desired columns.
  
      The default behaviour is to replace the original values. To store
      the original values in a new column, specify `prefix` or `suffix`
      in the parameters, or specify a dictionary with the desired column
      mapping using the `columns_mapping` parameter.
  
      Parameters
      ----------
      df : pandas.DataFrame
          A Pandas' DataFrame that must contain `columns`
  
      columns_to_transform : list of str
          A list of column names that will remain in the dataframe during training time (fit)
  
      transformation_function : function(pandas.DataFrame) -> pandas.DataFrame
          A function that receives a DataFrame as input, performs a transformation on its columns
          and returns another DataFrame.
  
      """
      import swifter  # NOQA
  
      def p(df: pd.DataFrame) -> pd.DataFrame:
          if is_vectorized:
              return df.assign(
                  **{
                      col: transformation_function(df[col])
                      for col in columns_to_transform
                  }
              )
  
          return df.assign(
              **{
                  col: df[col].swifter.apply(transformation_function)
                  for col in columns_to_transform
              }
          )
  
      p.__doc__ = learner_pred_fn_docstring("custom_transformer")
  
      log = {
          "custom_transformer": {
              "transformed_column": columns_to_transform,
              "transformation_function": transformation_function.__name__,
          }
      }
  
      return p, p(df), log
  
imports: from typing import Any, Callable, Dict, List, Union, Optional
  import numpy
  import pandas
  from numpy import nan
  from sklearn.preprocessing import StandardScaler
  from statsmodels.distributions import empirical_distribution
  from toolz import curry, merge, compose, mapcat
  from fklearn.common_docstrings import learner_return_docstring, learner_pred_fn_docstring
  from fklearn.training.utils import log_learner_time
  from fklearn.types import LearnerReturnType, LearnerLogType
  from fklearn.preprocessing.schema import column_duplicatable
label_desc: Use image node_id 17 for calling a global function with example usage: custom_transformer(df, columns_to_transform, transformation_function, is_vectorized) and returns: p,  p,  log, df, df