code: def test_gluon_trainer_type():
      def check_trainer_kv_type(
          stype, grad_stype, update_on_kv, expected
      ):
          x = mx.gluon.Parameter(
              "x",
              shape=(10, 1),
              lr_mult=1.0,
              stype=stype,
              grad_stype=grad_stype,
          )
          x.initialize(ctx=[mx.cpu(0), mx.cpu(1)], init="zeros")
          trainer = mx.gluon.Trainer(
              [x],
              "sgd",
              {"learning_rate": 0.1},
              kvstore=kv,
              update_on_kvstore=update_on_kv,
          )
          try:
              trainer._init_kvstore()
              assert trainer._kv_initialized
              assert trainer._update_on_kvstore is expected
          except Exception as err:
              assert isinstance(err, expected)
  
      check_trainer_kv_type("default", "default", None, True)
      check_trainer_kv_type("default", "default", True, True)
      check_trainer_kv_type("default", "default", False, False)
      check_trainer_kv_type("default", "row_sparse", None, True)
      check_trainer_kv_type("default", "row_sparse", False, ValueError)
      check_trainer_kv_type("row_sparse", "row_sparse", None, True)
      check_trainer_kv_type(
          "row_sparse", "row_sparse", False, ValueError
      )
      print(
          "worker " + str(my_rank) + " passed test_gluon_trainer_type"
      )
  
file_path: mxnet/tests/nightly/dist_sync_kvstore.py
imports: import sys
  import argparse
  import mxnet
  import numpy
  import numpy.random
  from mxnet.test_utils import assert_almost_equal, assert_exception
  from test_kvstore import compute_expected_quantization, compute_1bit, compute_2bit
label_desc: Use image node_id 10 for calling a global function with example usage: test_gluon_trainer_type() without return types