code: def accuracy(fmodel: Model, inputs: Any, labels: Any) -> float:
      inputs_, labels_ = ep.astensors(inputs, labels)
      del inputs, labels
  
      predictions = fmodel(inputs_).argmax(axis=-1)
      accuracy = (predictions == labels_).float32().mean()
      return accuracy.item()
  
file_path: foolbox/foolbox/utils.py
imports: from typing import Optional, Tuple, Any
  import eagerpy
  import warnings
  import os
  import numpy
  from .types import Bounds
  from .models import Model
label_desc: Use image node_id 1 for calling a global function with example usage: accuracy(fmodel, inputs, labels) and returns: accuracy