code: def test_when_trying_to_set_causal_mechanism_of_non_existing_node_then_raises_error():
      with pytest.raises(ValueError):
          ProbabilisticCausalModel().set_causal_mechanism(
              "X0", EmpiricalDistribution()
          )
  
file_path: dowhy/tests/gcm/test_graph.py
imports: import networkx
  import numpy
  import pandas
  import pytest
  from flaky import flaky
  from pytest import approx
  from dowhy.gcm import AdditiveNoiseModel, EmpiricalDistribution, ProbabilisticCausalModel, draw_samples, fit
  from dowhy.gcm.ml import create_linear_regressor
  from dowhy.graph import is_root_node
label_desc: Use image node_id 2 for calling a global function with example usage: test_when_trying_to_set_causal_mechanism_of_non_existing_node_then_raises_error() without return types