code: def test_maybe_num_nodes():
      edge_index = torch.tensor(
          [[0, 0, 1, 1, 2, 2, 2], [1, 2, 0, 2, 0, 1, 1]]
      )
  
      assert maybe_num_nodes(edge_index, 4) == 4
      assert maybe_num_nodes(edge_index) == 3
  
      adj = to_torch_coo_tensor(edge_index)
      assert maybe_num_nodes(adj, 4) == 4
      assert maybe_num_nodes(adj) == 3
  
imports: import torch
  from torch_geometric.utils import to_torch_coo_tensor
  from torch_geometric.utils.num_nodes import maybe_num_nodes, maybe_num_nodes_dict
label_desc: Use image node_id 1 for calling a global function with example usage: test_maybe_num_nodes() without return types