docs: def add_nodes_from(self, nodes, weights=None):
          """
          Add multiple nodes to the Graph.
  
          **The behviour of adding weights is different than in networkx.
  
          Parameters
          ----------
          nodes: iterable container
              A container of nodes (list, dict, set, or any hashable python
              object).
  
          weights: list, tuple (default=None)
              A container of weights (int, float). The weight value at index i
              is associated with the variable at index i.
  
          Examples
          --------
          >>> from pgmpy.base import DAG
          >>> G = DAG()
          >>> G.add_nodes_from(nodes=['A', 'B', 'C'])
          >>> sorted(G.nodes())
          ['A', 'B', 'C']
  
          Adding nodes with weights:
          >>> G.add_nodes_from(nodes=['D', 'E'], weights=[0.3, 0.6])
          >>> G.node['D']
          {'weight': 0.3}
          >>> G.node['E']
          {'weight': 0.6}
          >>> G.node['A']
          {'weight': None}
          """
          nodes = list(nodes)
  
          if weights:
              if len(nodes) != len(weights):
                  raise ValueError("The number of elements in nodes and weights"
                                   "should be equal.")
              for index in range(len(nodes)):
                  self.add_node(node=nodes[index], weight=weights[index])
          else:
              for node in nodes:
                  self.add_node(node=node)