code: def fog(x, severity=1):
      """Fog corruption to images.
  
      Adding fog to images. Fog is generated by diamond-square algorithm.
  
      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]. Added fog.
      """
      c = [(1.5, 2), (2.0, 2), (2.5, 1.7), (2.5, 1.5), (3.0, 1.4)][
          severity - 1
      ]
      x = np.array(x) / 255.0
      max_val = x.max()
      mapsize = 512
      shape = x.shape
      max_length = max(shape[0], shape[1])
      if max_length > mapsize:
          mapsize = 2 ** int(np.ceil(np.log2(float(max_length))))
      tmp = plasma_fractal(mapsize=mapsize, wibbledecay=c[1])
      tmp = tmp[: x.shape[0], : x.shape[1]]
      tmp = tmp[..., np.newaxis]
      x += c[0] * tmp
      x_clip = np.clip(x * max_val / (max_val + c[0]), 0, 1) * 255
      return around_and_astype(x_clip)
  
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 12 for calling a global function with example usage: fog(x, severity) and returns: around_and_astype