code: def _maybe_num_nodes(edge_index, num_nodes=None):
      if isinstance(num_nodes, int):
          return num_nodes
      elif isinstance(edge_index, torch.Tensor):
          return (
              int(edge_index.max()) + 1 if edge_index.numel() > 0 else 0
          )
      else:
          return max(edge_index.size(0), edge_index.size(1))
  
file_path: AutoGL/autogl/datasets/utils/_split_edges/train_test_split_edges.py
imports: import math
  import torch
  import typing
label_desc: Use image node_id 1 for calling a global function with example usage: _maybe_num_nodes(edge_index, num_nodes) and returns: num_nodes, unknown, max