code: def confusion_to_accuracy(confusion_matrix):
      """
      Given a confusion dictionary, return correct, total
      """
      correct = 0
      total = 0
      for l1 in confusion_matrix.keys():
          for l2 in confusion_matrix[l1].keys():
              if l1 == l2:
                  correct = correct + confusion_matrix[l1][l2]
              else:
                  total = total + confusion_matrix[l1][l2]
      return correct, (correct + total)
  
imports: from collections import defaultdict, namedtuple
label_desc: Use image node_id 3 for calling a global function with example usage: confusion_to_accuracy(confusion_matrix) and returns: correct,  unknown