code: def value_mapper(
      df: pd.DataFrame,
      value_maps: Dict[str, Dict],
      ignore_unseen: bool = True,
      replace_unseen_to: Any = np.nan,
  ) -> pd.DataFrame:
      """
      Map values in selected columns in the DataFrame according to dictionaries of replacements.
      Learner wrapper for apply_replacements
  
      Parameters
      -----------
  
      df: pandas.DataFrame
          A Pandas DataFrame containing the data to be replaced.
  
      value_maps: dict of dicts
          A dict mapping a col to dict mapping a value to its replacement. For example:
          value_maps = {"feature1": {1: 2, 3: 5, 6: 8}}
  
      ignore_unseen: bool
          If True, values not explicitly declared in value_maps will be left as is.
          If False, these will be replaced by replace_unseen_to.
  
      replace_unseen_to: Any
          Default value to replace when original value is not present in the `vec` dict for the feature.
      """
  
      def new_col_value_map(
          old_col_value_map: Dict[Any, Any], new_keys: List[Any]
      ) -> Dict[Any, Dict]:
          old_keys = old_col_value_map.keys()
          return {
              key: old_col_value_map[key] if key in old_keys else key
              for key in new_keys
          }
  
      columns = list(value_maps.keys())
      if ignore_unseen:
          value_maps = {
              col: new_col_value_map(
                  value_maps[col], list(df[col].unique())
              )
              for col in columns
          }
  
      def p(df: pd.DataFrame) -> pd.DataFrame:
          return apply_replacements(
              df, columns, value_maps, replace_unseen=replace_unseen_to
          )
  
      return p, p(df), {"value_maps": value_maps}
  
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 8 for calling a global function with example usage: value_mapper(df, value_maps, ignore_unseen, replace_unseen_to) and returns: p,  p,  dict, unknown, apply_replacements