code: def generate_edge_index(
      n_nodes: int, avg_degree: int, remove_loops: bool = True
  ) -> np.ndarray:
      """Returns source and destination nodes for `num_nodes * avg_degree` number of randomly
      generated edges. If remove_loops is True, then self-loops from the edge_index pairs
      are removed.
  
      Parameters
      ----------
      n_nodes: int
          Number of nodes in the graph
      avg_degree: int
          Average degree per node in a graph
      remove_loops: bool
          Remove self-loops in a graph
      """
      n_edges = n_nodes * avg_degree
      edge_index = np.random.randint(
          low=0, high=n_nodes, size=(2, n_edges)
      )
  
      if remove_loops:
          edge_index = remove_self_loops(edge_index)
      return edge_index
  
file_path: deepchem/deepchem/utils/fake_data_generator.py
imports: import random
  import numpy
  from deepchem.data import NumpyDataset
  from deepchem.feat import GraphData
label_desc: Use image node_id 1 for calling a global function with example usage: generate_edge_index(n_nodes, avg_degree, remove_loops) and returns: edge_index