code: def test_add_single_factor(self):
      self.graph.add_edges_from([("a", "phi1"), ("b", "phi1")])
      phi1 = DiscreteFactor(["a", "b"], [2, 2], np.random.rand(4))
      self.graph.add_factors(phi1)
      self.assertCountEqual(self.graph.factors, [phi1])
  
imports: import numpy
  import unittest
  from pgmpy.factors.discrete import DiscreteFactor
  from pgmpy.models import FactorGraph
  from pgmpy.models import MarkovNetwork
  from pgmpy.models import JunctionTree
  from pgmpy.tests import help_functions
label_desc: Use image node_id 2 for calling the TestFactorGraphFactorOperations obj's underlying member method code with example usage: obj.test_add_single_factor() without return types