code: def _append_arrs(
      arrs, use_shared_mem=False, expand=False, batch_axis=0
  ):
      """Internal impl for returning appened arrays as list."""
      if isinstance(arrs[0], mx.nd.NDArray):
          if use_shared_mem:
              out = [
                  x.as_in_context(mx.Context("cpu_shared", 0))
                  for x in arrs
              ]
          else:
              out = arrs
      else:
          if use_shared_mem:
              out = [
                  mx.nd.array(x, ctx=mx.Context("cpu_shared", 0))
                  for x in arrs
              ]
          else:
              out = [mx.nd.array(x) for x in arrs]
  
      # add batch axis
      if expand:
          out = [x.expand_dims(axis=batch_axis) for x in out]
      return out
  
imports: import logging
  import numpy
  import mxnet
label_desc: Use image node_id 3 for calling a global function with example usage: _append_arrs(arrs, use_shared_mem, expand, batch_axis) and returns: out