code: def test_given_categorical_variables_when_draw_interventional_samples_then_return_correct_sample_values():
      causal_model = ProbabilisticCausalModel(
          nx.DiGraph([("X0", "X2"), ("X1", "X2"), ("X2", "X3")])
      )
      causal_model.set_causal_mechanism("X0", EmpiricalDistribution())
      causal_model.set_causal_mechanism("X1", EmpiricalDistribution())
      causal_model.set_causal_mechanism(
          "X2",
          ClassifierFCM(
              classifier_model=create_logistic_regression_classifier()
          ),
      )
      causal_model.set_causal_mechanism(
          "X3",
          ClassifierFCM(
              classifier_model=create_logistic_regression_classifier()
          ),
      )
  
      X0 = np.random.normal(0, 1, 5000)
      X1 = np.random.choice(2, 5000).astype(str)
  
      X2 = []
      for x0, x1 in zip(X0, X1):
          if x1 == "0":
              X2.append(x0 + 2 > 0)
          else:
              X2.append(x0 - 2 > 0)
  
      X2 = np.array(X2).astype(str)
  
      X3 = []
      for x2 in X2:
          if x2 == "True":
              X3.append("False")
          else:
              X3.append("True")
  
      X3 = np.array(X3).astype(str)
  
      training_data = pd.DataFrame(
          {"X0": X0, "X1": X1, "X2": X2, "X3": X3}
      )
  
      fit(causal_model, training_data)
  
      intervention_results = interventional_samples(
          causal_model,
          dict(X0=lambda x: 0, X1=lambda x: "0"),
          num_samples_to_draw=100,
      )
  
      assert intervention_results["X0"].to_numpy() == approx(
          np.array([0] * 100)
      )
      assert np.all(
          intervention_results["X1"].to_numpy() == np.array(["0"] * 100)
      )
      assert (
          np.sum(intervention_results["X2"].to_numpy() == "True") > 95
      )
      assert (
          np.sum(intervention_results["X3"].to_numpy() == "False") > 95
      )
  
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 6 for calling a global function with example usage: test_given_categorical_variables_when_draw_interventional_samples_then_return_correct_sample_values() without return types