code: def propensity_of_treatment_score(
      data, covariates, treatment, model="logistic", variable_types=None
  ):
      if model == "logistic":
          model = LogisticRegression(solver="lbfgs")
          data, covariates = binarize_discrete(
              data, covariates, variable_types
          )
          model = model.fit(
              data[covariates], data[treatment].values.ravel()
          )
          scores = model.predict_proba(data[covariates])[:, 1]
          return scores
      else:
          raise NotImplementedError
  
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 1 for calling a global function with example usage: propensity_of_treatment_score(data, covariates, treatment, model, variable_types) and returns: scores