code: def spatter(
      img: np.ndarray,
      non_mud: Optional[np.ndarray],
      mud: Optional[np.ndarray],
      rain: Optional[np.ndarray],
      mode: str,
  ) -> np.ndarray:
      non_rgb_warning(img)
  
      coef = MAX_VALUES_BY_DTYPE[img.dtype]
      img = img.astype(np.float32) * (1 / coef)
  
      if mode == "rain":
          assert rain is not None
          img = img + rain
      elif mode == "mud":
          assert non_mud is not None and mud is not None
          img = img * non_mud + mud
      else:
          raise ValueError("Unsupported spatter mode: " + str(mode))
  
      return img * 255
  
imports: from __future__ import division
  from typing import Optional, Sequence, Union
  from warnings import warn
  import cv2
  import numpy
  import skimage
  from albumentations import random_utils
  from albumentations.augmentations.utils import MAX_VALUES_BY_DTYPE, _maybe_process_in_chunks, clip, clipped, ensure_contiguous, is_grayscale_image, is_rgb_image, non_rgb_warning, preserve_channel_dim, preserve_shape
label_desc: Use image node_id 60 for calling a global function with example usage: spatter(img, non_mud, mud, rain, mode) and returns: unknown