code: def test_query(self):
      for algo in ["ve", "bp"]:
          # Simpson model queries
          query_nodo1 = self.simp_infer.query(
              variables=["C"],
              do=None,
              evidence={"T": 1},
              inference_algo=algo,
          )
          np_test.assert_array_almost_equal(
              query_nodo1.values, np.array([0.5, 0.5])
          )
  
          query_nodo2 = self.simp_infer.query(
              variables=["C"],
              do=None,
              evidence={"T": 0},
              inference_algo=algo,
          )
          np_test.assert_array_almost_equal(
              query_nodo2.values, np.array([0.6, 0.4])
          )
  
          query1 = self.simp_infer.query(
              variables=["C"], do={"T": 1}, inference_algo=algo
          )
          np_test.assert_array_almost_equal(
              query1.values, np.array([0.6, 0.4])
          )
  
          query2 = self.simp_infer.query(
              variables=["C"], do={"T": 0}, inference_algo=algo
          )
          np_test.assert_array_almost_equal(
              query2.values, np.array([0.5, 0.5])
          )
  
          query3 = self.simp_infer.query(["C"], adjustment_set=["S"])
          np_test.assert_array_almost_equal(
              query3.values, np.array([0.55, 0.45])
          )
  
          # IV model queries
          query_nodo1 = self.iv_infer.query(
              ["Z"], do=None, inference_algo=algo
          )
          np_test.assert_array_almost_equal(
              query_nodo1.values, np.array([0.2, 0.8])
          )
  
          query_nodo2 = self.iv_infer.query(
              ["X"], do=None, evidence={"Z": 1}
          )
          np_test.assert_array_almost_equal(
              query_nodo2.values, np.array([0.48, 0.52])
          )
  
          query1 = self.iv_infer.query(["X"], do={"Z": 1})
          np_test.assert_array_almost_equal(
              query1.values, np.array([0.48, 0.52])
          )
  
          query2 = self.iv_infer.query(["Y"], do={"X": 1})
          np_test.assert_array_almost_equal(
              query2.values, np.array([0.77, 0.23])
          )
  
          query3 = self.iv_infer.query(
              ["Y"], do={"X": 1}, adjustment_set={"U"}
          )
          np_test.assert_array_almost_equal(
              query3.values, np.array([0.77, 0.23])
          )
  
imports: import unittest
  import numpy
  import numpy.testing
  import pandas
  from pgmpy.factors.discrete import TabularCPD
  from pgmpy.inference.CausalInference import CausalInference
  from pgmpy.models import BayesianNetwork
label_desc: Use image node_id 5 for calling the TestDoQuery obj's underlying member method code with example usage: obj.test_query() without return types