code: def test_given_binary_target_when_estimate_average_causal_effect_then_return_expected_result():
      T = np.random.choice(2, 1000, replace=True)
      X0 = np.random.normal(0, 0.1, 1000) + T
      X1 = np.random.normal(0, 0.1, 1000) + 0.5 * T
      Y = ((X0 + X1 + np.random.normal(0, 0.1, 1000)) >= 1.5).astype(
          str
      )
  
      data = pd.DataFrame(dict(T=T, X0=X0, X1=X1, Y=Y))
  
      causal_model = ProbabilisticCausalModel(
          nx.DiGraph(
              [("T", "X0"), ("T", "X1"), ("X0", "Y"), ("X1", "Y")]
          )
      )
      auto.assign_causal_mechanisms(
          causal_model, data, auto.AssignmentQuality.GOOD
      )
      fit(causal_model, data)
  
      assert average_causal_effect(
          causal_model,
          "Y",
          interventions_alternative={"T": lambda x: 1},
          interventions_reference={"T": lambda x: 0},
          num_samples_to_draw=1000,
      ) == approx(0.5, abs=0.1)
  
imports: import networkx
  import numpy
  import pandas
  import pytest
  from flaky import flaky
  from pytest import approx
  from dowhy.gcm import AdditiveNoiseModel, ClassifierFCM, DiscreteAdditiveNoiseModel, EmpiricalDistribution, InvertibleStructuralCausalModel, ProbabilisticCausalModel, auto, average_causal_effect, counterfactual_samples, fit, interventional_samples
  from dowhy.gcm.ml import create_hist_gradient_boost_regressor, create_linear_regressor, create_logistic_regression_classifier
label_desc: Use image node_id 15 for calling a global function with example usage: test_given_binary_target_when_estimate_average_causal_effect_then_return_expected_result() without return types