code: def test_invalid_operations():
      def check_invalid_gluon_trainer_reset():
          x = mx.gluon.Parameter(
              "x", shape=(4, 2), lr_mult=1.0, stype="row_sparse"
          )
          params = {"x": x}
          x.initialize(ctx=mx.cpu(0), init="zeros")
          trainer = mx.gluon.Trainer(
              params, "sgd", {"learning_rate": 0.1}, kvstore=kv
          )
          params = {"x": x._reduce()}
          mx.nd.save(
              "test_gluon_trainer_reset_" + str(my_rank) + ".params",
              params,
          )
          row_id = mx.nd.arange(0, 4)
          w = x.row_sparse_data(row_id)
          assert trainer._kv_initialized and trainer._update_on_kvstore
          mx.nd.waitall()
          # load would fail to reset kvstore since update_on_kvstore is True
          params = mx.nd.load(
              "test_gluon_trainer_reset_" + str(my_rank) + ".params"
          )
          assert_exception(
              x._load_init, RuntimeError, params["x"], None
          )
          print(
              "worker "
              + str(my_rank)
              + " passed check_invalid_gluon_trainer_reset"
          )
  
      def check_invalid_pull():
          kv.init(
              keys_invalid[0], mx.nd.ones((2, 2)).tostype("row_sparse")
          )
          out = mx.nd.ones((2, 2)).tostype("row_sparse")
          assert_exception(
              kv.pull,
              mx.MXNetError,
              "invalid_key",
              out=out,
              ignore_sparse=False,
          )
          print("worker " + str(my_rank) + " passed check_invalid_pull")
  
      check_invalid_gluon_trainer_reset()
      check_invalid_pull()
  
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 9 for calling a global function with example usage: test_invalid_operations() without return types