code: def _create_kvstore(kvstore, num_device, arg_params):
      """Create kvstore
      This function select and create a proper kvstore if given the kvstore type.
  
      Parameters
      ----------
      kvstore : KVStore or str
          The kvstore.
      num_device : int
          The number of devices
      arg_params : dict of str to `NDArray`.
          Model parameter, dict of name to `NDArray` of net's weights.
      """
      update_on_kvstore = bool(
          int(os.getenv("MXNET_UPDATE_ON_KVSTORE", "1"))
      )
      if kvstore is None:
          kv = None
      elif isinstance(kvstore, kvs.KVStoreBase):
          kv = kvstore
      elif isinstance(kvstore, str):
          # create kvstore using the string type
          if num_device == 1 and "dist" not in kvstore:
              # no need to use kv for single device and single machine
              kv = None
          else:
              kv = kvs.create(kvstore)
              if kvstore == "local":
                  # automatically select a proper local
                  max_size = max(
                      np.prod(param.shape)
                      for param in arg_params.values()
                  )
                  if max_size > 1024 * 1024 * 16:
                      update_on_kvstore = False
      else:
          raise TypeError("kvstore must be KVStore, str or None")
  
      if kv is None:
          update_on_kvstore = False
      else:
          update_on_kvstore &= kv.is_capable(kvs.KVStoreBase.OPTIMIZER)
  
      return (kv, update_on_kvstore)
  
file_path: mxnet/python/mxnet/model.py
imports: import os
  import logging
  from collections import namedtuple
  import numpy
  from .None import ndarray
  from .None import symbol
  from .None import kvstore
  from .device import cpu
label_desc: Use image node_id 2 for calling a global function with example usage: _create_kvstore(kvstore, num_device, arg_params) and returns: kv,  update_on_kvstore