code: def extract_params_as_shared_arrays(link):
      assert isinstance(link, chainer.Link)
      shared_arrays = {}
      for param_name, param in link.namedparams():
          typecode = param.array.dtype.char
          shared_arrays[param_name] = mp.RawArray(
              typecode, param.array.ravel()
          )
  
      for persistent_name, persistent in chainerrl.misc.namedpersistent(
          link
      ):
          if isinstance(persistent, np.ndarray):
              typecode = persistent.dtype.char
              shared_arrays[persistent_name] = mp.RawArray(
                  typecode, persistent.ravel()
              )
          else:
              assert np.isscalar(persistent)
              # Wrap by a 1-dim array because multiprocessing.RawArray does not
              # accept a 0-dim array.
              persistent_as_array = np.asarray([persistent])
              typecode = persistent_as_array.dtype.char
              shared_arrays[persistent_name] = mp.RawArray(
                  typecode, persistent_as_array
              )
      return shared_arrays
  
imports: import multiprocessing
  import warnings
  import chainer
  import numpy
  import chainerrl
  from chainerrl.misc import random_seed
label_desc: Use image node_id 7 for calling a global function with example usage: extract_params_as_shared_arrays(link) and returns: shared_arrays