code: def setUp(self):
      self.sn2 = {
          "grade": ["A", "B", "F"],
          "diff": ["high", "low"],
          "intel": ["poor", "good", "very good"],
      }
      self.sn1 = {
          "speed": ["low", "medium", "high"],
          "switch": ["on", "off"],
          "time": ["day", "night"],
      }
  
      self.sn2_no_names = {
          "grade": [0, 1, 2],
          "diff": [0, 1],
          "intel": [0, 1, 2],
      }
      self.sn1_no_names = {
          "speed": [0, 1, 2],
          "switch": [0, 1],
          "time": [0, 1],
      }
  
      self.phi1 = DiscreteFactor(
          ["speed", "switch", "time"], [3, 2, 2], np.ones(12)
      )
      self.phi2 = DiscreteFactor(
          ["speed", "switch", "time"],
          [3, 2, 2],
          np.ones(12),
          state_names=self.sn1,
      )
  
      self.cpd1 = TabularCPD(
          "grade",
          3,
          [
              [0.1, 0.1, 0.1, 0.1, 0.1, 0.1],
              [0.1, 0.1, 0.1, 0.1, 0.1, 0.1],
              [0.8, 0.8, 0.8, 0.8, 0.8, 0.8],
          ],
          evidence=["diff", "intel"],
          evidence_card=[2, 3],
      )
      self.cpd2 = TabularCPD(
          "grade",
          3,
          [
              [0.1, 0.1, 0.1, 0.1, 0.1, 0.1],
              [0.1, 0.1, 0.1, 0.1, 0.1, 0.1],
              [0.8, 0.8, 0.8, 0.8, 0.8, 0.8],
          ],
          evidence=["diff", "intel"],
          evidence_card=[2, 3],
          state_names=self.sn2,
      )
  
      student = BayesianNetwork([("diff", "grade"), ("intel", "grade")])
      diff_cpd = TabularCPD("diff", 2, [[0.2], [0.8]])
      intel_cpd = TabularCPD("intel", 2, [[0.3], [0.7]])
      grade_cpd = TabularCPD(
          "grade",
          3,
          [
              [0.1, 0.1, 0.1, 0.1],
              [0.1, 0.1, 0.1, 0.1],
              [0.8, 0.8, 0.8, 0.8],
          ],
          evidence=["diff", "intel"],
          evidence_card=[2, 2],
      )
      student.add_cpds(diff_cpd, intel_cpd, grade_cpd)
      self.model1 = Inference(student)
      self.model2 = Inference(student)
  
file_path: pgmpy/pgmpy/tests/test_utils/test_state_name.py
imports: import unittest
  import numpy
  import numpy.testing
  from pgmpy.factors.discrete import DiscreteFactor, TabularCPD
  from pgmpy.models import BayesianNetwork
  from pgmpy.inference import Inference
  from pgmpy.inference import VariableElimination
label_desc: Use image node_id 1 for calling the TestStateNameInit obj's underlying member method code with example usage: obj.setUp() without return types