code: def selector(
      df: pd.DataFrame,
      training_columns: List[str],
      predict_columns: List[str] = None,
  ) -> LearnerReturnType:
      """
      Filters a DataFrames by selecting only the desired columns.
  
      Parameters
      ----------
      df : pandas.DataFrame
          A Pandas' DataFrame that must contain `columns`
  
      training_columns : list of str
          A list of column names that will remain in the dataframe during training time (fit)
  
      predict_columns: list of str
          A list of column names that will remain in the dataframe during prediction time (transform)
          If None, it defaults to `training_columns`.
      """
  
      if predict_columns is None:
          predict_columns = training_columns
  
      def p(new_data_set: pd.DataFrame) -> pd.DataFrame:
          return new_data_set[predict_columns]
  
      p.__doc__ = learner_pred_fn_docstring("selector")
  
      log = {
          "selector": {
              "training_columns": training_columns,
              "predict_columns": predict_columns,
              "transformed_column": list(
                  set(training_columns).union(predict_columns)
              ),
          }
      }
  
      return p, df[training_columns], 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 1 for calling a global function with example usage: selector(df, training_columns, predict_columns) and returns: p,  df,  log, new_data_set