code: def preprocess_input_df(
      df: pd.DataFrame, required_cols: List[str] = None
  ) -> Tuple[pd.DataFrame, List[str]]:
      """
      :param df: A data frame of model results
      :param required_cols: Names of columns required for bias calculations.
          Default is None.
      :return: A data frame, list of columns associated with sample attributes
      """
      if not required_cols:
          required_cols = ["score"]
      try:
          check_required_cols(df, required_cols)
      except ValueError:
          logging.exception(
              "input dataframe does not have all the required columns"
          )
          raise
          logging.error(f"preprocessing.preprocess_input_df: {e}")
          raise
  
      non_attr_cols = required_cols + [
          "model_id",
          "as_of_date",
          "entity_id",
          "rank_abs",
          "rank_pct",
          "id",
          "label_value",
      ]
      non_string_cols = df.columns[
          (df.dtypes != object)
          & (df.dtypes != str)
          & (~df.columns.isin(non_attr_cols))
      ]
      df = discretize(df, non_string_cols)
  
      try:
          attr_cols_input = get_attr_cols(df, non_attr_cols)
      except ValueError as e:
          logging.error(f"preprocessing.preprocess_input_df: {e}")
          raise
  
      return df, attr_cols_input
  
imports: import logging
  import pandas
  from typing import List, Tuple
label_desc: Use image node_id 4 for calling a global function with example usage: preprocess_input_df(df, required_cols) and returns: df,  attr_cols_input