code: def _parse_and_check_input(self, input_dict):
      if "hits@" in self.eval_metric or "rocauc" == self.eval_metric:
          if not "y_pred_pos" in input_dict:
              raise RuntimeError("Missing key of y_pred_pos")
          if not "y_pred_neg" in input_dict:
              raise RuntimeError("Missing key of y_pred_neg")
  
          y_pred_pos, y_pred_neg = (
              input_dict["y_pred_pos"],
              input_dict["y_pred_neg"],
          )
  
          """
                  y_pred_pos: numpy ndarray or torch tensor of shape (num_edges, )
                  y_pred_neg: numpy ndarray or torch tensor of shape (num_edges, )
              """
  
          # convert y_pred_pos, y_pred_neg into either torch tensor or both numpy array
          # type_info stores information whether torch or numpy is used
  
          type_info = None
  
          # check the raw tyep of y_pred_pos
          if not (
              isinstance(y_pred_pos, np.ndarray)
              or (
                  torch is not None
                  and isinstance(y_pred_pos, torch.Tensor)
              )
          ):
              raise ValueError(
                  "y_pred_pos needs to be either numpy ndarray or torch tensor"
              )
  
          # check the raw type of y_pred_neg
          if not (
              isinstance(y_pred_neg, np.ndarray)
              or (
                  torch is not None
                  and isinstance(y_pred_neg, torch.Tensor)
              )
          ):
              raise ValueError(
                  "y_pred_neg needs to be either numpy ndarray or torch tensor"
              )
  
          # if either y_pred_pos or y_pred_neg is torch tensor, use torch tensor
          if torch is not None and (
              isinstance(y_pred_pos, torch.Tensor)
              or isinstance(y_pred_neg, torch.Tensor)
          ):
              # converting to torch.Tensor to numpy on cpu
              if isinstance(y_pred_pos, np.ndarray):
                  y_pred_pos = torch.from_numpy(y_pred_pos)
  
              if isinstance(y_pred_neg, np.ndarray):
                  y_pred_neg = torch.from_numpy(y_pred_neg)
  
              # put both y_pred_pos and y_pred_neg on the same device
              y_pred_pos = y_pred_pos.to(y_pred_neg.device)
  
              type_info = "torch"
  
          else:
              # both y_pred_pos and y_pred_neg are numpy ndarray
  
              type_info = "numpy"
  
          if not y_pred_pos.ndim == 1:
              raise RuntimeError(
                  "y_pred_pos must to 1-dim arrray, {}-dim array given".format(
                      y_pred_pos.ndim
                  )
              )
  
          if not y_pred_neg.ndim == 1:
              raise RuntimeError(
                  "y_pred_neg must to 1-dim arrray, {}-dim array given".format(
                      y_pred_neg.ndim
                  )
              )
  
          return y_pred_pos, y_pred_neg, type_info
  
      elif "mrr" == self.eval_metric:
          if not "y_pred_pos" in input_dict:
              raise RuntimeError("Missing key of y_pred_pos")
          if not "y_pred_neg" in input_dict:
              raise RuntimeError("Missing key of y_pred_neg")
  
          y_pred_pos, y_pred_neg = (
              input_dict["y_pred_pos"],
              input_dict["y_pred_neg"],
          )
  
          """
                  y_pred_pos: numpy ndarray or torch tensor of shape (num_edges, )
                  y_pred_neg: numpy ndarray or torch tensor of shape (num_edges, num_nodes_negative)
              """
  
          # convert y_pred_pos, y_pred_neg into either torch tensor or both numpy array
          # type_info stores information whether torch or numpy is used
  
          type_info = None
  
          # check the raw tyep of y_pred_pos
          if not (
              isinstance(y_pred_pos, np.ndarray)
              or (
                  torch is not None
                  and isinstance(y_pred_pos, torch.Tensor)
              )
          ):
              raise ValueError(
                  "y_pred_pos needs to be either numpy ndarray or torch tensor"
              )
  
          # check the raw type of y_pred_neg
          if not (
              isinstance(y_pred_neg, np.ndarray)
              or (
                  torch is not None
                  and isinstance(y_pred_neg, torch.Tensor)
              )
          ):
              raise ValueError(
                  "y_pred_neg needs to be either numpy ndarray or torch tensor"
              )
  
          # if either y_pred_pos or y_pred_neg is torch tensor, use torch tensor
          if torch is not None and (
              isinstance(y_pred_pos, torch.Tensor)
              or isinstance(y_pred_neg, torch.Tensor)
          ):
              # converting to torch.Tensor to numpy on cpu
              if isinstance(y_pred_pos, np.ndarray):
                  y_pred_pos = torch.from_numpy(y_pred_pos)
  
              if isinstance(y_pred_neg, np.ndarray):
                  y_pred_neg = torch.from_numpy(y_pred_neg)
  
              # put both y_pred_pos and y_pred_neg on the same device
              y_pred_pos = y_pred_pos.to(y_pred_neg.device)
  
              type_info = "torch"
  
          else:
              # both y_pred_pos and y_pred_neg are numpy ndarray
  
              type_info = "numpy"
  
          if not y_pred_pos.ndim == 1:
              raise RuntimeError(
                  "y_pred_pos must to 1-dim arrray, {}-dim array given".format(
                      y_pred_pos.ndim
                  )
              )
  
          if not y_pred_neg.ndim == 2:
              raise RuntimeError(
                  "y_pred_neg must to 2-dim arrray, {}-dim array given".format(
                      y_pred_neg.ndim
                  )
              )
  
          return y_pred_pos, y_pred_neg, type_info
  
      else:
          raise ValueError(
              "Undefined eval metric %s" % (self.eval_metric)
          )
  
file_path: ogb/ogb/linkproppred/evaluate.py
imports: import os
  import numpy
  import pandas
  from sklearn.metrics import roc_auc_score
label_desc: Use image node_id 2 for calling the Evaluator obj's underlying member method code with example usage: obj._parse_and_check_input(input_dict) and returns: y_pred_pos,  y_pred_neg,  type_info, y_pred_pos,  y_pred_neg,  type_info