code: def test_maybe_num_nodes_dict():
      edge_index_dict = {
          "1": torch.tensor(
              [[0, 0, 1, 1, 2, 2, 2], [1, 2, 0, 2, 0, 1, 1]]
          ),
          "2": torch.tensor([[0, 0, 1, 3], [1, 2, 0, 4]]),
      }
      num_nodes_dict = {"2": 6}
  
      assert maybe_num_nodes_dict(edge_index_dict) == {"1": 3, "2": 5}
      assert maybe_num_nodes_dict(edge_index_dict, num_nodes_dict) == {
          "1": 3,
          "2": 6,
      }
  
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 2 for calling a global function with example usage: test_maybe_num_nodes_dict() without return types