code: def simple_accuracy(preds, labels):
      # works also with nested lists of different lengths (needed for masked LM task)
      if type(preds) == type(labels) == list:
          preds = np.array(list(flatten_list(preds)))
          labels = np.array(list(flatten_list(labels)))
      assert type(preds) == type(labels) == np.ndarray
      correct = preds == labels
      return {"acc": correct.mean()}
  
imports: import logging
  import numpy
  import torch
  from functools import reduce
  from scipy.stats import pearsonr, spearmanr
  from seqeval.metrics import classification_report
  from seqeval.metrics import f1_score
  from sklearn.metrics import matthews_corrcoef, f1_score, mean_squared_error, r2_score, classification_report
  from farm.utils import flatten_list
label_desc: Use image node_id 3 for calling a global function with example usage: simple_accuracy(preds, labels) and returns: dict