code: def test_mcc():
      microMCC = mx.gluon.metric.create("mcc")
  
      assert np.isnan(microMCC.get()[1])
  
      # check divide by zero
      pred = mx.np.array([[0.9, 0.1], [0.8, 0.2]])
      label = mx.np.array([0, 0])
      microMCC.update([label], [pred])
      assert microMCC.get()[1] == 0.0
      microMCC.reset()
  
      pred11 = mx.np.array([[0.1, 0.9], [0.5, 0.5]])
      label11 = mx.np.array([1, 0])
      pred12 = mx.np.array([[0.85, 0.15], [1.0, 0.0]])
      label12 = mx.np.array([1, 0])
      pred21 = mx.np.array([[0.6, 0.4]])
      label21 = mx.np.array([0])
      pred22 = mx.np.array([[0.2, 0.8]])
      label22 = mx.np.array([1])
      microMCC.update([label11, label12], [pred11, pred12])
      assert microMCC.num_inst == 4
      tp1 = 1
      fp1 = 0
      fn1 = 1
      tn1 = 2
      mcc1 = (tp1 * tn1 - fp1 * fn1) / np.sqrt(
          (tp1 + fp1) * (tp1 + fn1) * (tn1 + fp1) * (tn1 + fn1)
      )
      np.testing.assert_almost_equal(microMCC.get()[1], mcc1)
  
      microMCC.update([label21, label22], [pred21, pred22])
      assert microMCC.num_inst == 6
      tp2 = 1
      fp2 = 0
      fn2 = 0
      tn2 = 1
      mcc2 = (tp2 * tn2 - fp2 * fn2) / np.sqrt(
          (tp2 + fp2) * (tp2 + fn2) * (tn2 + fp2) * (tn2 + fn2)
      )
      tpT = tp1 + tp2
      fpT = fp1 + fp2
      fnT = fn1 + fn2
      tnT = tn1 + tn2
      mccT = (tpT * tnT - fpT * fnT) / np.sqrt(
          (tpT + fpT) * (tpT + fnT) * (tnT + fpT) * (tnT + fnT)
      )
      np.testing.assert_almost_equal(microMCC.get()[1], mccT)
  
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 10 for calling a global function with example usage: test_mcc() without return types