code: def test_generate_ids():
      data = HeteroData()
  
      data["paper"].x = torch.randn(100, 128)
      data["author"].x = torch.randn(200, 128)
  
      data["paper", "author"].edge_index = get_random_edge_index(
          100, 200, 300
      )
      data["author", "paper"].edge_index = get_random_edge_index(
          200, 100, 400
      )
      assert len(data) == 2
  
      data.generate_ids()
      assert len(data) == 4
      assert data["paper"].n_id.tolist() == list(range(100))
      assert data["author"].n_id.tolist() == list(range(200))
      assert data["paper", "author"].e_id.tolist() == list(range(300))
      assert data["author", "paper"].e_id.tolist() == list(range(400))
  
imports: import copy
  import pytest
  import torch
  from torch_geometric.data import HeteroData
  from torch_geometric.data.storage import EdgeStorage
  from torch_geometric.testing import get_random_edge_index, get_random_tensor_frame, withPackage
  from torch_geometric.typing import TensorFrame
label_desc: Use image node_id 18 for calling a global function with example usage: test_generate_ids() without return types