code: def test_inference_query_statename(self):
      inf_op1 = self.model_with_state_names.query(
          ["grade"], evidence={"intel": "poor"}
      )
      inf_op2 = self.model_no_state_names.query(
          ["grade"], evidence={"intel": 0}
      )
      req_op = DiscreteFactor(
          ["grade"],
          [3],
          np.array([0.1, 0.1, 0.8]),
          state_names={"grade": ["A", "B", "F"]},
      )
      self.assertEqual(inf_op1, req_op)
      self.assertEqual(inf_op1, req_op)
  
      inf_op1 = self.model_with_state_names.map_query(
          ["grade"], evidence={"intel": "poor"}
      )
      inf_op2 = self.model_no_state_names.map_query(
          ["grade"], evidence={"intel": 0}
      )
      req_op1 = {"grade": "F"}
      req_op2 = {"grade": 2}
  
      self.assertEqual(inf_op1, req_op1)
      self.assertEqual(inf_op2, req_op2)
  
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 5 for calling the StateNameDecorator obj's underlying member method code with example usage: obj.test_inference_query_statename() without return types