code: def binarize_discrete(data, covariates, variable_types):
      to_remove = []
      if variable_types:
          for variable in covariates:
              variable_type = variable_types[variable]
              if variable_type in ["d", "o", "u"]:
                  dummies = get_dummies(data[variable])
                  dummies.columns = [
                      variable + str(col) for col in dummies.columns
                  ]
                  dummies = dummies[dummies.columns[:-1]]
                  covariates += list(dummies.columns)
                  for var_name in dummies.columns:
                      variable_types[var_name] = "b"
                  data = pd.concat((data, dummies), axis=1)
                  to_remove.append(variable)
      for variable in to_remove:
          covariates.remove(variable)
          del data[variable]
      return data, covariates
  
file_path: dowhy/dowhy/utils/propensity_score.py
imports: import numpy
  import pandas
  from pandas import get_dummies
  from sklearn.linear_model import LogisticRegression
  from sklearn.preprocessing import LabelEncoder
  from statsmodels.nonparametric.kernel_density import EstimatorSettings, KDEMultivariateConditional
label_desc: Use image node_id 7 for calling a global function with example usage: binarize_discrete(data, covariates, variable_types) and returns: data,  covariates