code: def get_random_edge_index(
      num_src_nodes: int,
      num_dst_nodes: int,
      num_edges: int,
      dtype: Optional[torch.dtype] = None,
      device: Optional[torch.device] = None,
      coalesce: bool = False,
  ) -> Tensor:
      row = torch.randint(
          num_src_nodes, (num_edges,), dtype=dtype, device=device
      )
      col = torch.randint(
          num_dst_nodes, (num_edges,), dtype=dtype, device=device
      )
      edge_index = torch.stack([row, col], dim=0)
  
      if coalesce:
          edge_index = coalesce_fn(edge_index)
  
      return edge_index
  
file_path: pytorch_geometric/torch_geometric/testing/data.py
imports: from typing import Callable, Optional
  import torch
  from torch import Tensor
  from torch_geometric.data import HeteroData, InMemoryDataset
  from torch_geometric.typing import TensorFrame, torch_frame
  from torch_geometric.utils import coalesce
label_desc: Use image node_id 1 for calling a global function with example usage: get_random_edge_index(num_src_nodes, num_dst_nodes, num_edges, dtype, device, coalesce) and returns: edge_index