code: def to_array(self):
      if self.result is None:
          self.evaluate
      result_metrics = sorted(
          self.result[list(self.result.keys())[0]].keys()
      )
      a = np.zeros(
          (len(self.labels), len(result_metrics)), dtype=np.float32
      )
      if isinstance(self.labels, dict):
          for i, label in enumerate(self.labels.keys()):
              for j, metric in enumerate(result_metrics):
                  a[i][j] = self.result[self.labels[label]][metric]
      else:
          for i, label in enumerate(self.labels):
              for j, metric in enumerate(result_metrics):
                  a[i][j] = self.result[label][metric]
      return a
  
imports: import collections
  import inspect
  import json
  import hashlib
  from datetime import datetime
  from multiprocessing.pool import Pool
  import numpy
  import pandas
  import SimpleITK
  from collections import OrderedDict
  from .metrics import ConfusionMatrix, ALL_METRICS
label_desc: Use image node_id 10 for calling the Evaluator obj's underlying member method code with example usage: obj.to_array() and returns: a