def requires_pillow_jpeg(func):
 @wraps(func)
 def decorated_func(*args, **kwargs):
  '\n        Execute the function if we have JPEG support in Pillow.\n        '
  try:
   from PIL import Image
  except ImportError:
   raise SkipTest('Pillow is not installed (or not found)')
  if (not getattr(Image.core, 'jpeg_decoder', False)):
   raise SkipTest('Pillow cannot open JPEG files')
  return func(*args, **kwargs)
 return decorated_func

def requires_pillow_jpeg ( func ) : @ wraps ( func ) def decorated_func ( * args , ** kwargs ) : try : from PIL import Image except ImportError : raise SkipTest ( 'Pillow is not installed (or not found)' ) if ( not getattr ( Image . core , 'jpeg_decoder' , False ) ) : raise SkipTest ( 'Pillow cannot open JPEG files' ) return func ( * args , ** kwargs ) return decorated_func
a decorator to indicate that the function requires jpeg support for pillow .