code: def test_pushpull_list_kv_pair():
      """aggregate value on muliple devices"""
  
      def check_aggregator(kv, key, key_list=None):
          kv.broadcast(key, mx.nd.zeros(shape), out=mx.nd.empty(shape))
          # devices
          num_devs = 4
          devs = [mx.Context("cpu", i) for i in range(num_devs)]
  
          # single
          vals = [mx.nd.ones(shape, d) for d in devs]
          outs = [mx.nd.empty(shape, d) for d in devs]
  
          kv.pushpull(key, vals, out=outs)
          for out in outs:
              check_diff_to_scalar(out, num_devs)
  
          # list
          if key_list is None:
              return
          num_keys = len(key_list)
          kv.broadcast(
              key_list,
              [mx.nd.zeros(shape)] * num_keys,
              out=[mx.nd.empty(shape)] * num_keys,
          )
          vals = [[mx.nd.ones(shape, d) * 2.0 for d in devs]] * num_keys
          outs = [[mx.nd.empty(shape, d) for d in devs]] * num_keys
          kv.pushpull(key_list, vals, out=outs)
          for out in outs:
              for o in out:
                  check_diff_to_scalar(o, num_devs * 2.0)
  
      check_aggregator(init_kv("device"), 3, keys)
      check_aggregator(init_kv("device"), "a", str_keys)
      check_aggregator(init_kv("teststore"), 3)
      check_aggregator(init_kv("teststore"), "a")
  
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 6 for calling a global function with example usage: test_pushpull_list_kv_pair() without return types