code: def test_add_nodes_from_with_weight(self):
      self.graph.add_node(1)
      self.graph.add_nodes_from(
          ["weight_b", "weight_c"], weights=[0.3, 0.5]
      )
      self.assertEqual(self.graph.nodes["weight_b"]["weight"], 0.3)
      self.assertEqual(self.graph.nodes["weight_c"]["weight"], 0.5)
      self.assertEqual(self.graph.nodes[1]["weight"], None)
  
imports: from pgmpy.base import UndirectedGraph
  from pgmpy.tests import help_functions
  import unittest
label_desc: Use image node_id 8 for calling the TestUndirectedGraphCreation obj's underlying member method code with example usage: obj.test_add_nodes_from_with_weight() without return types