original_docstring: 
          generate graph from nodes list and edges list which identify the nodes and edges
          that should be add in graph, and the random weight range of every node and edge.
  
          Args:
              nodes (list/set): list of node idex / node-weight map, element form is tuple(nid, weight)
              edges (list/set): list of edge: (e_idex1, e_idex2) / edge-weight map, element form is tuple(nid1, nid2, edge_weight)
              weight_range (int): random weight range of every node and edge
  
          Returns:
              g (nx.Graph): graph generated by args
          
docstring: generate graph from nodes list and edges list which identify the nodes and edges
  that should be add in graph, and the random weight range of every node and edge.
docstring_tokens: generate graph from nodes list and edges list which identify the nodes and edges that should be add in graph and the random weight range of every node and edge .
code: def generate_weighted_graph(cls, nodes, edges, weight_range=10):
          """
          generate graph from nodes list and edges list which identify the nodes and edges
          that should be add in graph, and the random weight range of every node and edge.
  
          Args:
              nodes (list/set): list of node idex / node-weight map, element form is tuple(nid, weight)
              edges (list/set): list of edge: (e_idex1, e_idex2) / edge-weight map, element form is tuple(nid1, nid2, edge_weight)
              weight_range (int): random weight range of every node and edge
  
          Returns:
              g (nx.Graph): graph generated by args
          """
          g = nx.Graph()
          if isinstance(nodes, list) and isinstance(edges, list):
              for v in nodes:
                  w = np.random.choice(range(weight_range))
                  g.add_node(v, weight=w)
  
              for e in edges:
                  w = np.random.choice(range(weight_range))
                  g.add_edge(e[0], e[1], weight=w)
          else:
              for item in nodes:
                  g.add_node(item[0], weight=item[1])
  
              for item in edges:
                  g.add_edge(item[0], item[1], weight=item[2])
          return g
code_tokens: def generate_weighted_graph ( cls , nodes , edges , weight_range = 10 ) : g = nx . Graph ( ) if isinstance ( nodes , list ) and isinstance ( edges , list ) : for v in nodes : w = np . random . choice ( range ( weight_range ) ) g . add_node ( v , weight = w ) for e in edges : w = np . random . choice ( range ( weight_range ) ) g . add_edge ( e [ 0 ] , e [ 1 ] , weight = w ) else : for item in nodes : g . add_node ( item [ 0 ] , weight = item [ 1 ] ) for item in edges : g . add_edge ( item [ 0 ] , item [ 1 ] , weight = item [ 2 ] ) return g
short_docstring: generate graph from nodes list and edges list which identify the nodes and edges
  that should be add in graph, and the random weight range of every node and edge.
short_docstring_tokens: generate graph from nodes list and edges list which identify the nodes and edges that should be add in graph and the random weight range of every node and edge .
comment: """
          generate graph from nodes list and edges list which identify the nodes and edges
          that should be add in graph, and the random weight range of every node and edge.
  
          Args:
              nodes (list/set): list of node idex / node-weight map, element form is tuple(nid, weight)
              edges (list/set): list of edge: (e_idex1, e_idex2) / edge-weight map, element form is tuple(nid1, nid2, edge_weight)
              weight_range (int): random weight range of every node and edge
  
          Returns:
              g (nx.Graph): graph generated by args
          """