code: def _de_dummy_code_df(df, sep="=", set_category=False):
      """
      taken verbatim from aif360
      @param df: one hot encoded dataframe with column names like "race=White" etc.
      @param sep: separator of one hot encoded column names
      @param set_category:
      @return: de-dummy-fied dataframe. Categorical features' values will be strings.
      """
      feature_names_dum_d, feature_names_nodum = _parse_feature_names(
          df.columns
      )
      df_new = pd.DataFrame(
          index=df.index,
          columns=feature_names_nodum
          + list(feature_names_dum_d.keys()),
      )
  
      for fname in feature_names_nodum:
          df_new[fname] = df[fname].values.copy()
  
      for fname, vl in feature_names_dum_d.items():
          for v in vl:
              df_new.loc[df[fname + sep + str(v)] == 1, fname] = str(v)
  
      if set_category:
          for fname in feature_names_dum_d.keys():
              df_new[fname] = df_new[fname].astype("category")
  
      return df_new
  
file_path: AIX360/aix360/algorithms/imd/utils.py
imports: import numpy
  import pandas
  import networkx
  from collections import defaultdict
  from aix360.algorithms.imd.rule import Rule
label_desc: Use image node_id 2 for calling a global function with example usage: _de_dummy_code_df(df, sep, set_category) and returns: df_new