def uses_mandrill(func):
 @wraps(func)
 def wrapped_func(*args, **kwargs):
  kwargs['mail_client'] = get_mandrill_client()
  return func(*args, **kwargs)
 return wrapped_func

def uses_mandrill ( func ) : @ wraps ( func ) def wrapped_func ( * args , ** kwargs ) : kwargs [ 'mail_client' ] = get_mandrill_client ( ) return func ( * args , ** kwargs ) return wrapped_func
this decorator takes a function with keyword argument "mail_client" and fills it in with the mail_client for the mandrill account .