code: def _prepend_mean(arr, pad_amt, num, axis=-1):
      """
      Prepend `pad_amt` mean values along `axis`.
  
      Parameters
      ----------
      arr : ndarray
          Input array of arbitrary shape.
      pad_amt : int
          Amount of padding to prepend.
      num : int
          Depth into `arr` along `axis` to calculate mean.
          Range: [1, `arr.shape[axis]`] or None (entire axis)
      axis : int
          Axis along which to pad `arr`.
  
      Returns
      -------
      padarr : ndarray
          Output array, with `pad_amt` values prepended along `axis`. The
          prepended region is the mean of the first `num` values along `axis`.
  
      """
      if pad_amt == 0:
          return arr
  
      # Equivalent to edge padding for single value, so do that instead
      if num == 1:
          return _prepend_edge(arr, pad_amt, axis)
  
      # Use entire array if `num` is too large
      if num is not None:
          if num >= arr.shape[axis]:
              num = None
  
      # Slice a chunk from the edge to calculate stats on
      mean_slice = _slice_first(arr.shape, num, axis=axis)
  
      # Extract slice, calculate mean
      mean_chunk = arr[mean_slice].mean(axis, keepdims=True)
      _round_ifneeded(mean_chunk, arr.dtype)
  
      # Concatenate `arr` with `mean_chunk`, extended along `axis` by `pad_amt`
      return _do_prepend(
          arr, mean_chunk.repeat(pad_amt, axis), axis=axis
      )
  
imports: from __future__ import division, absolute_import, print_function
  import numpy
  from numpy.core.overrides import array_function_dispatch
label_desc: Use image node_id 16 for calling a global function with example usage: _prepend_mean(arr, pad_amt, num, axis) and returns: _do_prepend, arr, _prepend_edge