code: def test_markov_inference_init(self):
      infer_markov = Inference(self.markov)
      infer_markov._initialize_structures()
      self.assertEqual(
          set(infer_markov.variables), {"a", "b", "c", "d"}
      )
      self.assertEqual(
          infer_markov.cardinality, {"a": 2, "b": 2, "c": 2, "d": 2}
      )
      self.assertEqual(
          infer_markov.factors,
          {
              "a": [
                  DiscreteFactor(
                      ["a", "b"], [2, 2], np.array([100, 1, 1, 100])
                  ),
                  DiscreteFactor(
                      ["a", "c"], [2, 2], np.array([40, 30, 100, 20])
                  ),
              ],
              "b": [
                  DiscreteFactor(
                      ["a", "b"], [2, 2], np.array([100, 1, 1, 100])
                  ),
                  DiscreteFactor(
                      ["b", "d"], [2, 2], np.array([1, 100, 100, 1])
                  ),
              ],
              "c": [
                  DiscreteFactor(
                      ["a", "c"], [2, 2], np.array([40, 30, 100, 20])
                  ),
                  DiscreteFactor(
                      ["c", "d"], [2, 2], np.array([60, 60, 40, 40])
                  ),
              ],
              "d": [
                  DiscreteFactor(
                      ["b", "d"], [2, 2], np.array([1, 100, 100, 1])
                  ),
                  DiscreteFactor(
                      ["c", "d"], [2, 2], np.array([60, 60, 40, 40])
                  ),
              ],
          },
      )
  
file_path: pgmpy/pgmpy/tests/test_inference/test_Inference.py
imports: import unittest
  import numpy
  from pgmpy.models import BayesianNetwork
  from pgmpy.models import MarkovNetwork
  from pgmpy.factors.discrete import DiscreteFactor
  from pgmpy.factors.discrete import TabularCPD
  from pgmpy.inference import Inference
  from collections import defaultdict
label_desc: Use image node_id 3 for calling the TestInferenceBase obj's underlying member method code with example usage: obj.test_markov_inference_init() without return types