code: def motion_blur(x, severity=1):
      """Apply motion blur to images.
  
      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 motion blur.
      """
      c = [(10, 3), (15, 5), (15, 8), (15, 12), (20, 15)][severity - 1]
  
      x = tfds.core.lazy_imports.PIL_Image.fromarray(x.astype(np.uint8))
  
      with tempfile.NamedTemporaryFile() as im_input:
          with tempfile.NamedTemporaryFile() as im_output:
              x.save(im_input.name, format="PNG")
  
              convert_bin = _imagemagick_bin()
              radius = c[0]
              sigma = c[1]
              angle = np.random.uniform(-45, -45)
  
              subprocess.check_output(
                  [
                      convert_bin,
                      "-motion-blur",
                      "{}x{}+{}".format(radius, sigma, angle),
                      im_input.name,
                      im_output.name,
                  ]
              )
  
              with open(im_output.name, "rb") as f:
                  output = f.read()
  
      x = tfds.core.lazy_imports.cv2.imdecode(
          np.frombuffer(output, np.uint8),
          tfds.core.lazy_imports.cv2.IMREAD_UNCHANGED,
      )
  
      if x.shape != (224, 224):
          x = np.clip(x[..., [2, 1, 0]], 0, 255)  # BGR to RGB
      else:  # greyscale to RGB
          x = np.clip(np.array([x, x, x]).transpose((1, 2, 0)), 0, 255)
  
      return around_and_astype(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 20 for calling a global function with example usage: motion_blur(x, severity) and returns: around_and_astype