code: def pixelate(x, severity=1):
      """Pixelate images.
  
      Conduct pixelating corruptions to images by first shrinking the images and
      then resizing to original size.
  
      Args:
        x: numpy array, uncorrupted image, assumed to have uint8 pixel in [0,255].
        severity: integer, severity of corruption.
  
      Returns:
        numpy array, image with uint8 pixels in [0,255]. Applied pixelating
        corruption.
      """
      c = [0.6, 0.5, 0.4, 0.3, 0.25][severity - 1]
      shape = x.shape
      x = tfds.core.lazy_imports.PIL_Image.fromarray(x.astype(np.uint8))
      x = x.resize((int(shape[1] * c), int(shape[0] * c)))
      x = x.resize((shape[1], shape[0]))
      return np.asarray(x)
  
imports: import io
  import subprocess
  import tempfile
  import numpy
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
  import tensorflow_datasets.public_api
label_desc: Use image node_id 16 for calling a global function with example usage: pixelate(x, severity) and returns: np