class_docstr: Corrupted ImageNet2012 dataset.
class_docstr_tok: ["Corrupted","ImageNet2012","dataset","."]
docstr: Return corrupted images.
  
  Args:
    x: numpy array, uncorrupted image.
  
  Returns:
    numpy array, corrupted images.
docstr_tok: ["Return","corrupted","images",".","Args",":","x",":","numpy","array",",","uncorrupted","image",".","Returns",":","numpy","array",",","corrupted","images","."]
code: def _get_corrupted_example(self, x):
      """Return corrupted images.
  
      Args:
        x: numpy array, uncorrupted image.
  
      Returns:
        numpy array, corrupted images.
      """
      corruption_type = self.builder_config.corruption_type
      severity = self.builder_config.severity
      x = np.clip(x, 0, 255)
  
      return {
          "gaussian_noise": corruptions.gaussian_noise,
          "shot_noise": corruptions.shot_noise,
          "impulse_noise": corruptions.impulse_noise,
          "defocus_blur": corruptions.defocus_blur,
          "glass_blur": corruptions.glass_blur,
          "motion_blur": corruptions.motion_blur,
          "zoom_blur": corruptions.zoom_blur,
          "snow": corruptions.snow,
          "frost": corruptions.frost,
          "fog": corruptions.fog,
          "brightness": corruptions.brightness,
          "contrast": corruptions.contrast,
          "elastic_transform": corruptions.elastic_transform,
          "pixelate": corruptions.pixelate,
          "jpeg_compression": corruptions.jpeg_compression,
          "gaussian_blur": corruptions.gaussian_blur,
          "saturate": corruptions.saturate,
          "spatter": corruptions.spatter,
          "speckle_noise": corruptions.speckle_noise,
      }[corruption_type](x, severity)
  
file_path: datasets/tensorflow_datasets/datasets/imagenet2012_corrupted/imagenet2012_corrupted_dataset_builder.py
imports: from absl import logging
  import numpy
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
  from tensorflow_datasets.datasets.imagenet2012 import imagenet2012_dataset_builder
  from tensorflow_datasets.datasets.imagenet2012 import imagenet_common
  from tensorflow_datasets.image_classification import corruptions
  import tensorflow_datasets.public_api
label_desc: Use image node_id 4 for calling the Builder obj's underlying member method code with example usage: obj._get_corrupted_example(x) and returns: dict