code: def test_given_observed_sample_when_estimate_counterfactual_then_returns_correct_sample_values():
      (
          causal_model,
          _,
      ) = _create_and_fit_simple_probabilistic_causal_model()
  
      observed_samples = pd.DataFrame(
          {"X0": [1], "X1": [3], "X2": [3], "X3": [4]}
      )
  
      sample = counterfactual_samples(
          causal_model,
          dict(X2=lambda x: 2),
          observed_data=observed_samples,
      )
      assert sample["X0"].to_numpy().squeeze() == 1
      assert sample["X1"].to_numpy().squeeze() == 3
      assert sample["X2"].to_numpy().squeeze() == 2
      assert sample["X3"].to_numpy().squeeze() == approx(3.5, abs=0.05)
  
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 10 for calling a global function with example usage: test_given_observed_sample_when_estimate_counterfactual_then_returns_correct_sample_values() without return types