code: def test_given_causal_graph_based_estimation_func_when_confidence_interval_then_can_use_fit_and_compute():
      def draw_single_sample(causal_graph, variable):
          return draw_samples(causal_graph, 1)[variable][0]
  
      causal_model = ProbabilisticCausalModel(nx.DiGraph([("X", "Y")]))
      causal_model.set_causal_mechanism("X", EmpiricalDistribution())
      causal_model.set_causal_mechanism(
          "Y",
          AdditiveNoiseModel(create_hist_gradient_boost_regressor()),
      )
  
      median, interval = confidence_intervals(
          fit_and_compute(
              draw_single_sample,
              causal_model,
              bootstrap_training_data=pd.DataFrame(
                  {
                      "X": [1, 3, 4, 4, 1, 3, 6, 3, 3, 6, 3, 4],
                      "Y": [4, 5, 4, 4, 4, 5, 3, 6, 5, 3, 6, 4],
                  }
              ),
              bootstrap_data_subset_size_fraction=0.5,
              variable="X",
          )
      )
  
      assert median == pytest.approx(4.0, abs=1.1)
      assert np.allclose(interval, [1.0, 6.0], atol=2.0)
  
file_path: dowhy/tests/gcm/test_confidence_intervals_cms.py
imports: import networkx
  import numpy
  import pandas
  import pytest
  from flaky import flaky
  from dowhy.gcm import AdditiveNoiseModel, EmpiricalDistribution, ProbabilisticCausalModel, bootstrap_sampling, draw_samples, fit_and_compute
  from dowhy.gcm.confidence_intervals import confidence_intervals
  from dowhy.gcm.ml import create_hist_gradient_boost_regressor
label_desc: Use image node_id 1 for calling a global function with example usage: test_given_causal_graph_based_estimation_func_when_confidence_interval_then_can_use_fit_and_compute() and returns: draw_samples