code: def test_metric():
      """test with no metric, list of metrics, invalid metric"""
      net = _get_test_network()
      train_data, _ = _get_test_data()
      num_epochs = 1
      device = mx.cpu()
  
      loss = gluon.loss.L2Loss()
      net.initialize(device=device)
      trainer = gluon.Trainer(
          net.collect_params(), "sgd", {"learning_rate": 0.001}
      )
      # input no metric
      est = Estimator(
          net=net, loss=loss, trainer=trainer, device=device
      )
      est.fit(train_data=train_data, epochs=num_epochs)
      # input list of metrics
      metrics = [mx.gluon.metric.Accuracy(), mx.gluon.metric.Accuracy()]
      est = Estimator(
          net=net,
          loss=loss,
          train_metrics=metrics,
          trainer=trainer,
          device=device,
      )
      est.fit(train_data=train_data, epochs=num_epochs)
      # input invalid metric
      with pytest.raises(ValueError):
          est = Estimator(
              net=net,
              loss=loss,
              train_metrics="acc",
              trainer=trainer,
              device=device,
          )
      # test default metric
      loss = gluon.loss.SoftmaxCrossEntropyLoss()
      est = Estimator(
          net=net, loss=loss, trainer=trainer, device=device
      )
      assert isinstance(est.train_metrics[0], mx.gluon.metric.Accuracy)
  
imports: import sys
  import unittest
  import warnings
  import pytest
  import mxnet
  from mxnet import gluon
  from mxnet.gluon import nn
  from mxnet.gluon.contrib.estimator import *
  from mxnet.gluon.contrib.estimator.event_handler import *
label_desc: Use image node_id 7 for calling a global function with example usage: test_metric() without return types