code: def test_when_using_parent_relevance_with_categorical_data_then_returns_correct_results():
      causal_model = StructuralCausalModel(
          nx.DiGraph(
              [
                  ("X0", "Y"),
                  ("X1", "Y"),
                  ("X2", "Y"),
                  ("X3", "Y"),
                  ("X4", "Y"),
              ]
          )
      )
      causal_model.set_causal_mechanism(
          "X0", ScipyDistribution(stats.uniform, loc=0, scale=1)
      )
      causal_model.set_causal_mechanism(
          "X1", ScipyDistribution(stats.uniform, loc=0, scale=1)
      )
      causal_model.set_causal_mechanism(
          "X2", ScipyDistribution(stats.uniform, loc=0, scale=1)
      )
      causal_model.set_causal_mechanism(
          "X3", ScipyDistribution(stats.uniform, loc=0, scale=1)
      )
      causal_model.set_causal_mechanism(
          "X4", ScipyDistribution(stats.uniform, loc=0, scale=1)
      )
      causal_model.set_causal_mechanism("Y", ClassifierFCM())
  
      X = np.random.uniform(0, 1, (1000, 5))
      Y = []
  
      for n in X:
          if n[0] + n[1] > 1:
              Y.append(0)
          else:
              Y.append(1)
  
      X0 = X[:, 0]
      X1 = X[:, 1]
      X2 = X[:, 2]
      X3 = X[:, 3]
      X4 = X[:, 4]
      Y = np.array(Y).astype(str)
  
      fit(
          causal_model,
          data=pd.DataFrame(
              {"X0": X0, "X1": X1, "X2": X2, "X3": X3, "X4": X4, "Y": Y}
          ),
      )
  
      relevance, noise = parent_relevance(
          causal_model,
          "Y",
          num_samples_randomization=1000,
          num_samples_baseline=100,
      )
  
      assert relevance[("X0", "Y")] == approx(0.125, abs=0.05)
      assert relevance[("X1", "Y")] == approx(0.125, abs=0.05)
      assert relevance[("X2", "Y")] == approx(0, abs=0.05)
      assert relevance[("X3", "Y")] == approx(0, abs=0.05)
      assert relevance[("X4", "Y")] == approx(0, abs=0.05)
      assert noise == approx(0, abs=0.05)
  
file_path: dowhy/tests/gcm/test_feature_relevance.py
imports: import networkx
  import numpy
  import pandas
  from flaky import flaky
  from pytest import approx
  from scipy import stats
  from dowhy.gcm import AdditiveNoiseModel, ClassifierFCM, ScipyDistribution, StructuralCausalModel, auto, confidence_intervals, fit
  from dowhy.gcm.feature_relevance import feature_relevance_distribution, feature_relevance_sample, parent_relevance
  from dowhy.gcm.ml import create_linear_regressor, create_logistic_regression_classifier
  from dowhy.gcm.shapley import ShapleyApproximationMethods, ShapleyConfig
  from dowhy.gcm.uncertainty import estimate_entropy_of_probabilities
  from dowhy.gcm.util.general import means_difference
label_desc: Use image node_id 2 for calling a global function with example usage: test_when_using_parent_relevance_with_categorical_data_then_returns_correct_results() without return types