def requires_nltk_corpus(func):
 @wraps(func)
 def decorated(*args, **kwargs):
  try:
   return func(*args, **kwargs)
  except LookupError as err:
   print err
   raise MissingCorpusError()
 return decorated

def requires_nltk_corpus ( func ) : @ wraps ( func ) def decorated ( * args , ** kwargs ) : try : return func ( * args , ** kwargs ) except LookupError as err : print err raise MissingCorpusError ( ) return decorated
wraps a function that requires an nltk corpus .