code: def test_single_voxel_grid():
      pos = torch.tensor(
          [
              [0.0, 0.0],
              [1.0, 1.0],
              [2.0, 2.0],
              [3.0, 3.0],
              [4.0, 4.0],
          ]
      )
      edge_index = torch.tensor([[0, 0, 3], [1, 2, 4]])
      batch = torch.tensor([0, 0, 0, 1, 1])
      x = torch.randn(5, 16)
  
      cluster = voxel_grid(pos, size=5, batch=batch)
      assert cluster.tolist() == [0, 0, 0, 1, 1]
  
      data = Batch(x=x, edge_index=edge_index, pos=pos, batch=batch)
      data = avg_pool(cluster, data)
  
      cluster_no_batch = voxel_grid(pos, size=5)
      assert cluster_no_batch.tolist() == [0, 0, 0, 0, 0]
  
      data_no_batch = Batch(x=x, edge_index=edge_index, pos=pos)
      data_no_batch = avg_pool(cluster_no_batch, data_no_batch)
  
imports: import torch
  from torch_geometric.data import Batch
  from torch_geometric.nn import avg_pool, voxel_grid
  from torch_geometric.testing import withPackage
label_desc: Use image node_id 2 for calling a global function with example usage: test_single_voxel_grid() without return types