code: def generate_unmatched_data(generate_regression_data):
      generated = False
  
      def _generate_data():
          if not generated:
              y, X, treatment, tau, b, e = generate_regression_data()
  
              features = ["x{}".format(i) for i in range(X.shape[1])]
              df = pd.DataFrame(X, columns=features)
              df[TREATMENT_COL] = treatment
  
              df_c = df.loc[treatment == 0]
              df_t = df.loc[treatment == 1]
  
              df = pd.concat(
                  [df_t, df_c, df_c], axis=0, ignore_index=True
              )
  
              pm = ElasticNetPropensityModel(random_state=RANDOM_SEED)
              ps = pm.fit_predict(df[features], df[TREATMENT_COL])
              df[SCORE_COL] = ps
              df[GROUP_COL] = np.random.randint(0, 2, size=df.shape[0])
  
          return df, features
  
      yield _generate_data
  
file_path: causalml/tests/test_match.py
imports: import numpy
  import pandas
  import pytest
  from causalml.match import NearestNeighborMatch, MatchOptimizer
  from causalml.propensity import ElasticNetPropensityModel
  from .const import RANDOM_SEED, TREATMENT_COL, SCORE_COL, GROUP_COL
label_desc: Use image node_id 1 for calling a global function with example usage: generate_unmatched_data(generate_regression_data) and returns: df,  features