code: def get_edge_index(
      num_src_nodes: int,
      num_dst_nodes: int,
      avg_degree: float,
      is_undirected: bool = False,
      remove_loops: bool = False,
  ) -> Tensor:
      num_edges = int(num_src_nodes * avg_degree)
      row = torch.randint(
          num_src_nodes, (num_edges,), dtype=torch.int64
      )
      col = torch.randint(
          num_dst_nodes, (num_edges,), dtype=torch.int64
      )
      edge_index = torch.stack([row, col], dim=0)
  
      if remove_loops:
          edge_index, _ = remove_self_loops(edge_index)
  
      num_nodes = max(num_src_nodes, num_dst_nodes)
      if is_undirected:
          edge_index = to_undirected(edge_index, num_nodes=num_nodes)
      else:
          edge_index = coalesce(edge_index, num_nodes=num_nodes)
  
      return edge_index
  
file_path: pytorch_geometric/torch_geometric/datasets/fake.py
imports: import random
  from collections import defaultdict
  from itertools import product
  from typing import Callable, Dict, List, Optional, Tuple, Union
  import torch
  from torch import Tensor
  from torch_geometric.data import Data, HeteroData, InMemoryDataset
  from torch_geometric.utils import coalesce, remove_self_loops, to_undirected
label_desc: Use image node_id 3 for calling a global function with example usage: get_edge_index(num_src_nodes, num_dst_nodes, avg_degree, is_undirected, remove_loops) and returns: edge_index