code: def accuracy(
      test=None, reference=None, confusion_matrix=None, **kwargs
  ):
      if confusion_matrix is None:
          confusion_matrix = ConfusionMatrix(test, reference)
  
      tp, fp, tn, fn = confusion_matrix.get_matrix()
      return float((tp + tn) / (tp + fp + tn + fn))
  
imports: import numpy
  from medpy import metric
label_desc: Use image node_id 8 for calling a global function with example usage: accuracy(test, reference, confusion_matrix) and returns: float