code: def test_given_categorical_input_data_when_fit_causal_graph_with_linear_anm_then_learns_correct_coefficients():
      scm = StructuralCausalModel(
          nx.DiGraph([("X0", "X2"), ("X1", "X2")])
      )
      scm.set_causal_mechanism(
          "X0", ScipyDistribution(stats.norm, loc=0, scale=1)
      )
      scm.set_causal_mechanism("X1", EmpiricalDistribution())
      scm.set_causal_mechanism(
          "X2",
          AdditiveNoiseModel(
              prediction_model=create_linear_regressor()
          ),
      )
  
      training_data = _generate_data_with_categorical_input()
      fit(scm, data=training_data)
  
      # Mean from the categorical part is: (-5 + 5+ 10) / 3 = 10/3
      assert scm.causal_mechanism(
          "X2"
      ).prediction_model.sklearn_model.coef_ == approx(
          np.array([2, -5 - 10 / 3, 10 - 10 / 3, 5 - 10 / 3]), abs=0.02
      )
      assert scm.causal_mechanism(
          "X2"
      ).prediction_model.sklearn_model.intercept_ == approx(
          10 / 3, abs=0.02
      )
  
imports: from typing import cast
  import networkx
  import numpy
  import pandas
  import pytest
  from flaky import flaky
  from pytest import approx
  from scipy import stats
  from scipy.stats import norm
  from dowhy.gcm import AdditiveNoiseModel, ClassifierFCM, DiscreteAdditiveNoiseModel, EmpiricalDistribution, PostNonlinearModel, ProbabilisticCausalModel, ScipyDistribution, StructuralCausalModel, draw_samples, fit
  from dowhy.gcm.auto import assign_causal_mechanisms
  from dowhy.gcm.divergence import estimate_kl_divergence_continuous_clf
  from dowhy.gcm.ml import SklearnRegressionModel, create_linear_regressor, create_linear_regressor_with_given_parameters, create_logistic_regression_classifier
  from dowhy.gcm.ml.regression import InvertibleExponentialFunction, InvertibleIdentityFunction, InvertibleLogarithmicFunction
  from dowhy.gcm.util.general import is_discrete
label_desc: Use image node_id 3 for calling a global function with example usage: test_given_categorical_input_data_when_fit_causal_graph_with_linear_anm_then_learns_correct_coefficients() without return types