code: def test(
      model,
      loader,
      device,
      hetero,
      progress_bar=True,
      desc="Evaluation",
  ) -> None:
      if progress_bar:
          loader = tqdm(loader, desc=desc)
      total_examples = total_correct = 0
      if hetero:
          for batch in loader:
              batch = batch.to(device)
              if "adj_t" in batch:
                  edge_index_dict = batch.adj_t_dict
              else:
                  edge_index_dict = batch.edge_index_dict
              out = model(batch.x_dict, edge_index_dict)
              batch_size = batch["paper"].batch_size
              out = out["paper"][:batch_size]
              pred = out.argmax(dim=-1)
  
              total_examples += batch_size
              total_correct += int(
                  (pred == batch["paper"].y[:batch_size]).sum()
              )
      else:
          for batch in loader:
              batch = batch.to(device)
              if "adj_t" in batch:
                  edge_index = batch.adj_t
              else:
                  edge_index = batch.edge_index
              out = model(batch.x, edge_index)
              batch_size = batch.batch_size
              out = out[:batch_size]
              pred = out.argmax(dim=-1)
  
              total_examples += batch_size
              total_correct += int((pred == batch.y[:batch_size]).sum())
      return total_correct / total_examples
  
file_path: pytorch_geometric/benchmark/utils/utils.py
imports: import os
  import os.path
  from datetime import datetime
  import torch
  from ogb.nodeproppred import PygNodePropPredDataset
  from tqdm import tqdm
  import torch_geometric.transforms
  from torch_geometric.data import HeteroData
  from torch_geometric.datasets import OGB_MAG, Reddit
  from torch_geometric.nn import GAT, GCN, PNA, EdgeCNN, GraphSAGE
  from torch_geometric.utils import index_to_mask
  from .hetero_gat import HeteroGAT
  from .hetero_sage import HeteroGraphSAGE
label_desc: Use image node_id 7 for calling a global function with example usage: test(model, loader, device, hetero, progress_bar, desc) and returns: unknown