code: def test_device():
      """test with no device, list of device, invalid device"""
      net = _get_test_network()
      loss = gluon.loss.L2Loss()
      metrics = mx.gluon.metric.Accuracy()
      # input no device
      est = Estimator(net=net, loss=loss, train_metrics=metrics)
      # input list of device
      gpus = mx.device.num_gpus()
      device = (
          [mx.gpu(i) for i in range(gpus)] if gpus > 0 else [mx.cpu()]
      )
      net = _get_test_network()
      est = Estimator(
          net=net, loss=loss, train_metrics=metrics, device=device
      )
      # input invalid device
      with pytest.raises(ValueError):
          est = Estimator(
              net=net, loss=loss, train_metrics=metrics, device="cpu"
          )
  
      with pytest.raises(AssertionError):
          est = Estimator(
              net=net,
              loss=loss,
              train_metrics=metrics,
              device=[mx.gpu(0), mx.gpu(100)],
          )
  
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 9 for calling a global function with example usage: test_device() without return types