code: def feature_duplicator(
      df: pd.DataFrame,
      columns_to_duplicate: Optional[List[str]] = None,
      columns_mapping: Optional[Dict[str, str]] = None,
      prefix: Optional[str] = None,
      suffix: Optional[str] = None,
  ) -> LearnerReturnType:
      """
      Duplicates some columns in the dataframe.
  
      When encoding features, a good practice is to save the encoded
      version in a different column rather than replacing the
      original values. The purpose of this function is to duplicate
      the column to be encoded, to be later replaced by the encoded
      values.
  
      The duplication method is used to preserve the original
      behaviour (replace).
  
      Parameters
      ----------
      df: pandas.DataFrame
          A Pandas' DataFrame with columns_to_duplicate columns
  
      columns_to_duplicate: list of str
          List of columns names
  
      columns_mapping: int (default None)
          Mapping of source columns to destination columns
  
      prefix: int (default None)
          prefix to add to columns to duplicate
  
      suffix: int (default None)
          Suffix to add to columns to duplicate
  
      Returns
      ----------
      increased_dataset : pandas.DataFrame
          A dataset with repeated columns
      """
  
      columns_final_mapping = (
          columns_mapping
          if columns_mapping is not None
          else {
              col: (prefix or "") + str(col) + (suffix or "")
              for col in columns_to_duplicate
          }
          if columns_to_duplicate
          else dict()
      )
  
      def p(new_df: pd.DataFrame) -> pd.DataFrame:
          categ_columns = {
              dest_col: new_df[src_col]
              for src_col, dest_col in columns_final_mapping.items()
          }
          return new_df.assign(**categ_columns)
  
      p.__doc__ = feature_duplicator.__doc__
  
      log: LearnerLogType = {
          "feature_duplicator": {
              "columns_to_duplicate": columns_to_duplicate,
              "columns_mapping": columns_mapping,
              "prefix": prefix,
              "suffix": suffix,
              "columns_final_mapping": columns_final_mapping,
          }
      }
  
      return p, p(df.copy()), log
  
file_path: fklearn/src/fklearn/preprocessing/schema.py
imports: import functools
  import inspect
  import pandas
  import toolz
  from typing import Any, Callable, Dict, List, Optional, Union
  from fklearn.types import LearnerLogType, LearnerReturnType
label_desc: Use image node_id 1 for calling a global function with example usage: feature_duplicator(df, columns_to_duplicate, columns_mapping, prefix, suffix) and returns: p,  p,  log, new_df