code: def accuracy(output, labels):
      """Return accuracy of output compared to labels.
  
      Parameters
      ----------
      output : torch.Tensor
          output from model
      labels : torch.Tensor or numpy.array
          node labels
  
      Returns
      -------
      float
          accuracy
      """
      if not hasattr(labels, "__len__"):
          labels = [labels]
      if type(labels) is not torch.Tensor:
          labels = torch.LongTensor(labels)
      preds = output.max(1)[1].type_as(labels)
      correct = preds.eq(labels).double()
      correct = correct.sum()
      return correct / len(labels)
  
file_path: AutoGL/autogl/module/model/pyg/robust/utils.py
imports: import numpy
  import scipy.sparse
  import torch
label_desc: Use image node_id 1 for calling a global function with example usage: accuracy(output, labels) and returns: unknown