code: def acc_all(items):
      # Only count as correct if all answers are labeled correctly for each question
      question_scoring_dict = {}
      preds = list(zip(*items))[0]
      docs = list(zip(*items))[1]
  
      for doc, pred in zip(docs, preds):
          paragraph_id = doc["idx"]["paragraph"]
          question_id = doc["idx"]["question"]
          if (paragraph_id, question_id) not in question_scoring_dict:
              question_scoring_dict[(paragraph_id, question_id)] = []
  
          gold_label = doc["label"] == 1
  
          question_scoring_dict[(paragraph_id, question_id)].append(
              gold_label == pred
          )
      acc = np.mean(
          [int(all(x)) for x in question_scoring_dict.values()]
      )
      return acc
  
imports: import math
  from collections.abc import Iterable
  import numpy
  import sacrebleu
  import sklearn.metrics
  import random
  from collections import defaultdict
label_desc: Use image node_id 10 for calling a global function with example usage: acc_all(items) and returns: acc