code: def test_sync_init():
      def check_init(kv, cur_keys, cur_shape, device=False):
          ctx = mx.gpu(0) if device else mx.cpu()
          val = [mx.nd.zeros(cur_shape, ctx) for i in cur_keys]
          for i in range(len(cur_keys)):
              expected = i
              kv.init(cur_keys[i], [mx.nd.ones(cur_shape, ctx) * i])
              kv.pull(cur_keys[i], out=val[i])
              check_diff_to_scalar(val[i], expected)
  
      check_init(kv, init_test_keys, shape)
      check_init(kv, init_test_keys_big, big_shape)
      check_init(kv, init_test_keys_device, shape, device=True)
      check_init(kv, init_test_keys_device_big, big_shape, device=True)
      my_rank = kv.rank
      print("worker " + str(my_rank) + " is initialized")
  
file_path: mxnet/tests/nightly/dist_device_sync_kvstore.py
imports: import sys
  import mxnet
  import numpy
  import numpy.random
  import time
label_desc: Use image node_id 4 for calling a global function with example usage: test_sync_init() without return types