code: def cf_iris_explainer(request, logistic_iris):
      X, y, lr = logistic_iris
      predict_fn = lr.predict_proba
      cf_explainer = Counterfactual(
          predict_fn=predict_fn,
          shape=(1, 4),
          target_class=request.param,
          lam_init=1e-1,
          max_iter=1000,
          max_lam_steps=10,
      )
  
      yield X, y, lr, cf_explainer
      tf.keras.backend.clear_session()
  
file_path: alibi/alibi/explainers/tests/test_counterfactual.py
imports: import pytest
  import numpy
  from sklearn.datasets import load_iris
  from sklearn.linear_model import LogisticRegression
  import tensorflow
  from alibi.api.defaults import DEFAULT_META_CF, DEFAULT_DATA_CF
  from alibi.explainers.counterfactual import _define_func
  from alibi.explainers import Counterfactual
label_desc: Use image node_id 2 for calling a global function with example usage: cf_iris_explainer(request, logistic_iris) without return types