code: def cm_batch(cm):
      # generate a batch yielding a given confusion matrix
      n = len(cm)
      ident = np.identity(n)
      labels = []
      preds = []
      for i in range(n):
          for j in range(n):
              labels += [i] * cm[i][j]
              preds += [ident[j]] * cm[i][j]
      return (
          [mx.np.array(labels, dtype="int32")],
          [mx.np.array(preds)],
      )
  
imports: import mxnet
  from mxnet.test_utils import use_np
  import numpy
  import scipy
  from scipy.stats import pearsonr
  import json
  import math
  from common import xfail_when_nonstandard_decimal_separator
  from copy import deepcopy
label_desc: Use image node_id 13 for calling a global function with example usage: cm_batch(cm) and returns: list,  list