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