code: def blur_avg_(image, k):
      """Blur an image in-place by computing averages over local neighbourhoods.
  
      This operation *may* change the input image in-place.
  
      The padding behaviour around the image borders is cv2's
      ``BORDER_REFLECT_101``.
  
      Added in 0.5.0.
  
      **Supported dtypes**:
  
          * ``uint8``: yes; fully tested
          * ``uint16``: yes; tested
          * ``uint32``: no (1)
          * ``uint64``: no (2)
          * ``int8``: yes; tested (3)
          * ``int16``: yes; tested
          * ``int32``: no (4)
          * ``int64``: no (5)
          * ``float16``: yes; tested (6)
          * ``float32``: yes; tested
          * ``float64``: yes; tested
          * ``float128``: no
          * ``bool``: yes; tested (7)
  
          - (1) rejected by ``cv2.blur()``
          - (2) loss of resolution in ``cv2.blur()`` (result is ``int32``)
          - (3) ``int8`` is mapped internally to ``int16``, ``int8`` itself
                leads to cv2 error "Unsupported combination of source format
                (=1), and buffer format (=4) in function 'getRowSumFilter'" in
                ``cv2``
          - (4) results too inaccurate
          - (5) loss of resolution in ``cv2.blur()`` (result is ``int32``)
          - (6) ``float16`` is mapped internally to ``float32``
          - (7) ``bool`` is mapped internally to ``float32``
  
      Parameters
      ----------
      image : numpy.ndarray
          The image to blur. Expected to be of shape ``(H, W)`` or ``(H, W, C)``.
  
      k : int or tuple of int
          Kernel size to use. A single ``int`` will lead to an ``k x k``
          kernel. Otherwise a ``tuple`` of two ``int`` ``(height, width)``
          is expected.
  
      Returns
      -------
      numpy.ndarray
          The blurred image. Same shape and dtype as the input.
          (Input image *might* have been altered in-place.)
  
      """
      if isinstance(k, tuple):
          k_height, k_width = k
      else:
          k_height, k_width = k, k
  
      shape = image.shape
      if 0 in shape:
          return image
  
      if k_height <= 0 or k_width <= 0 or (k_height, k_width) == (1, 1):
          return image
  
      iadt.gate_dtypes_strs(
          {image.dtype},
          allowed="bool uint8 uint16 int8 int16 float16 float32 float64",
          disallowed="uint32 uint64 int32 int64 float128",
      )
  
      input_dtype = image.dtype
      if image.dtype in {iadt._BOOL_DTYPE, iadt._FLOAT16_DTYPE}:
          image = image.astype(np.float32, copy=False)
      elif image.dtype == iadt._INT8_DTYPE:
          image = image.astype(np.int16, copy=False)
  
      input_ndim = len(shape)
      if input_ndim == 2 or shape[-1] <= 512:
          image = _normalize_cv2_input_arr_(image)
          image_aug = cv2.blur(image, (k_width, k_height), dst=image)
          # cv2.blur() removes channel axis for single-channel images
          if input_ndim == 3 and image_aug.ndim == 2:
              image_aug = image_aug[..., np.newaxis]
      else:
          # TODO this is quite inefficient
          # handling more than 512 channels in cv2.blur()
          channels = [
              cv2.blur(
                  _normalize_cv2_input_arr_(image[..., c]),
                  (k_width, k_height),
              )
              for c in sm.xrange(shape[-1])
          ]
          image_aug = np.stack(channels, axis=-1)
  
      if input_dtype.kind == "b":
          image_aug = image_aug > 0.5
      elif input_dtype in {iadt._INT8_DTYPE, iadt._FLOAT16_DTYPE}:
          image_aug = iadt.restore_dtypes_(image_aug, input_dtype)
  
      return image_aug
  
imports: from __future__ import print_function, division, absolute_import
  import numpy
  from scipy import ndimage
  import cv2
  import six.moves
  import imgaug
  from imgaug.imgaug import _normalize_cv2_input_arr_
  from .None import meta
  from .None import convolutional
  from ..None import parameters
  from ..None import dtypes
label_desc: Use image node_id 5 for calling a global function with example usage: blur_avg_(image, k) and returns: image_aug, image, image