code: def eval(
      model, dataset, device, args, train_data, val_data, test_data
  ):
      # make temporary copy of encoder
      tmp_encoder = copy.deepcopy(model.online_encoder).eval()
      val_scores = None
  
      if args.dataset == "ppi":
          train_data = compute_representations(
              tmp_encoder, train_data, device
          )
          val_data = compute_representations(
              tmp_encoder, val_data, device
          )
          test_data = compute_representations(
              tmp_encoder, test_data, device
          )
          num_classes = train_data[1].shape[1]
          val_scores, test_scores = fit_ppi_linear(
              num_classes,
              train_data,
              val_data,
              test_data,
              device,
              args.num_eval_splits,
          )
      elif args.dataset != "wiki_cs":
          representations, labels = compute_representations(
              tmp_encoder, dataset, device
          )
          test_scores = fit_logistic_regression(
              representations.cpu().numpy(),
              labels.cpu().numpy(),
              data_random_seed=args.data_seed,
              repeat=args.num_eval_splits,
          )
      else:
          g = dataset[0]
          train_mask = g.ndata["train_mask"]
          val_mask = g.ndata["val_mask"]
          test_mask = g.ndata["test_mask"]
          representations, labels = compute_representations(
              tmp_encoder, dataset, device
          )
          test_scores = fit_logistic_regression_preset_splits(
              representations.cpu().numpy(),
              labels.cpu().numpy(),
              train_mask,
              val_mask,
              test_mask,
          )
  
      return val_scores, test_scores
  
file_path: dgl/examples/pytorch/bgrl/main.py
imports: import copy
  import os
  import warnings
  import dgl
  import numpy
  import torch
  from eval_function import fit_logistic_regression, fit_logistic_regression_preset_splits, fit_ppi_linear
  from model import BGRL, compute_representations, GCN, GraphSAGE_GCN, MLP_Predictor
  from torch.nn.functional import cosine_similarity
  from torch.optim import AdamW
  from tqdm import tqdm
  from utils import CosineDecayScheduler, get_dataset, get_graph_drop_transform
label_desc: Use image node_id 2 for calling a global function with example usage: eval(model, dataset, device, args, train_data, val_data, test_data) and returns: val_scores,  test_scores