code: def test_set_optimizer():
      def check_unsupported_methods(kv):
          assert not kv.is_capable("optimizer")
          optimizer = mx.optimizer.create("sgd")
          assertRaises(NotImplementedError, kv.set_optimizer, optimizer)
          assertRaises(
              NotImplementedError, kv.save_optimizer_states, "test"
          )
          assertRaises(
              NotImplementedError, kv.load_optimizer_states, "test"
          )
  
      kv = mx.kv.create("teststore")
      check_unsupported_methods(kv)
  
file_path: mxnet/tests/python/unittest/test_kvstore_custom.py
imports: import mxnet
  import numpy
  import unittest
  from mxnet.test_utils import rand_ndarray, assert_almost_equal
  from common import assertRaises
  from mxnet.base import py_str, MXNetError
label_desc: Use image node_id 9 for calling a global function with example usage: test_set_optimizer() without return types