code: def discretize(
      df: pd.DataFrame, target_cols: List[str]
  ) -> pd.DataFrame:
      """
      :param df: A data frame of model results
      :param target_cols: Names of columns to discretize
      :return: A data frame
      """
      for col in target_cols:
          unique_values = df[col].unique()
          if len(unique_values) > 1:
              bins, values = pd.qcut(
                  df[col],
                  4,
                  precision=2,
                  labels=False,
                  duplicates="drop",
                  retbins=True,
              )
              try:
                  df[col] = bins.map(
                      lambda x: "%0.2f" % values[x]
                      + "-"
                      + "%0.2f" % values[x + 1]
                  )
              except Exception as e:
                  logging.info(
                      "Something strange with a column in the input_df: %s",
                      e,
                  )
                  df = df.drop(col)
          else:
              try:
                  df[col] = df[col].astype(str)
              except Exception as e:
                  logging.info(
                      f"Something strange with a column in the input_df: {e}"
                  )
                  df = df.drop(col)
      return df
  
imports: import logging
  import pandas
  from typing import List, Tuple
label_desc: Use image node_id 3 for calling a global function with example usage: discretize(df, target_cols) and returns: df