code: def is_valid_image(self, raw_data):
          '''
          Wand library makes sure when opening any image that is fine, when
          the image is corrupted raises an exception.
          '''
  
          try:
              Image(blob=raw_data)
              return True
          except (exceptions.CorruptImageError, exceptions.MissingDelegateError):
              return Falsf is_valid_image(self, raw_data):
          '''
          Wand library makes sure when opening any image that is fine, when
          the image is corrupted raises an exception.
          '''
  
          try:
              Image(blob=raw_data)
              return True
          except (exceptions.CorruptImageError, exceptions.MissingDelegateError):
              return False
docs: Wand library makes sure when opening any image that is fine, when
          the image is corrupted raises an exception.