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