docstr: Observing the state of a node should affect the marginals of dependent nodes
code: def test_observations_affect_marginals(
      self, train_model, train_data_idx
  ):
      """Observing the state of a node should affect the marginals of dependent nodes"""
  
      bn = BayesianNetwork(train_model)
      bn.fit_node_states(train_data_idx).fit_cpds(train_data_idx)
  
      ie = InferenceEngine(bn)
  
      m1 = ie.query({})
      m2 = ie.query({"d": 1})
  
      assert m2["d"][0] == 0
      assert m2["d"][1] == 1
      assert not math.isclose(m2["b"][1], m1["b"][1], abs_tol=0.01)
  
imports: import math
  import pytest
  from causalnex.inference import InferenceEngine
  from causalnex.network import BayesianNetwork
  from causalnex.structure import StructureModel
  from causalnex.structure.notears import from_pandas
label_desc: Use image node_id 5 for calling the TestInferenceEngineIdx obj's underlying member method code with example usage: obj.test_observations_affect_marginals(train_model, train_data_idx) without return types