code: def perturbator(
      data: pd.DataFrame,
      cols: List[str],
      corruption_fn: ColumnWisePerturbFnType,
  ) -> pd.DataFrame:
      """
      transforms specific columns of a dataset according to an artificial
      corruption function.
  
      Parameters
      ----------
      data : pandas.DataFrame
          A Pandas' DataFrame
  
      cols : List[str]
          A list of columns to apply the corruption function
  
      corruption_fn : function pandas.Series -> pandas.Series
          An arbitrary corruption function
  
      Returns
      ----------
      A transformed dataset
      """
      return data.assign(
          **{col: corruption_fn(data[col]) for col in cols}
      )
  
file_path: fklearn/src/fklearn/validation/perturbators.py
imports: import random
  from typing import List
  import numpy
  from toolz import curry
  import pandas
  from fklearn.types import ColumnWisePerturbFnType
label_desc: Use image node_id 5 for calling a global function with example usage: perturbator(data, cols, corruption_fn) and returns: data