code: def test(ctx, net, val_data):
      metric = mx.metric.Accuracy()
      for i, (data, label) in enumerate(val_data):
          data = data.as_in_context(ctx)
          label = label.as_in_context(ctx)
          output = net(data)
          metric.update([label], [output])
  
      return metric.get()
  
file_path: sagemaker-python-sdk/tests/data/mxnet_mnist/mnist_gluon.py
imports: import argparse
  import random
  import mxnet
  import numpy
  from mxnet import autograd, gluon
  from mxnet.gluon import nn
label_desc: Use image node_id 2 for calling a global function with example usage: test(ctx, net, val_data) and returns: metric