code: def test_add_nodes_from_weight(self):
      self.graph = DAG()
      self.graph.add_nodes_from(
          ["weighted_b", "weighted_c"], weights=[0.5, 0.6]
      )
      self.assertEqual(self.graph.nodes["weighted_b"]["weight"], 0.5)
      self.assertEqual(self.graph.nodes["weighted_c"]["weight"], 0.6)
  
      self.graph = DAG()
      self.graph.add_nodes_from(
          ["weighted_b", "weighted_c"], weights=[0.5, 0.6], latent=True
      )
      self.assertEqual(self.graph.nodes["weighted_b"]["weight"], 0.5)
      self.assertEqual(self.graph.nodes["weighted_c"]["weight"], 0.6)
      self.assertEqual(
          self.graph.latents, set(["weighted_b", "weighted_c"])
      )
  
      self.graph = DAG()
      self.graph.add_nodes_from(
          ["weighted_b", "weighted_c"],
          weights=[0.5, 0.6],
          latent=[True, False],
      )
      self.assertEqual(self.graph.nodes["weighted_b"]["weight"], 0.5)
      self.assertEqual(self.graph.nodes["weighted_c"]["weight"], 0.6)
      self.assertEqual(self.graph.latents, set(["weighted_b"]))
  
      self.graph.add_nodes_from(["e", "f"])
      self.assertEqual(self.graph.nodes["e"]["weight"], None)
      self.assertEqual(self.graph.nodes["f"]["weight"], None)
  
imports: import unittest
  import networkx
  import numpy
  import pgmpy.tests.help_functions
  from pgmpy.base import DAG, PDAG
label_desc: Use image node_id 9 for calling the TestDAGCreation obj's underlying member method code with example usage: obj.test_add_nodes_from_weight() without return types