code: def test_add_metapaths_max_sample() -> None:
      torch.manual_seed(12345)
  
      data = generate_data()
  
      metapaths = [[("p", "c"), ("c", "p")]]
      transform = AddMetaPaths(metapaths, max_sample=1)
  
      meta = transform(data)
      assert meta["metapath_0"].edge_index.size(1) < 9
  
file_path: pytorch_geometric/test/transforms/test_add_metapaths.py
imports: import torch
  from torch import tensor
  from torch_geometric.data import HeteroData
  from torch_geometric.transforms import AddMetaPaths, AddRandomMetaPaths
  from torch_geometric.utils import coalesce
label_desc: Use image node_id 3 for calling a global function with example usage: test_add_metapaths_max_sample() without return types