def requires_app_credentials(func):
 @wraps(func)
 def auth_wrapper(self, *args, **kwargs):
  (client_id, client_secret) = self.session.retrieve_client_credentials()
  if (client_id and client_secret):
   return func(self, *args, **kwargs)
  else:
   from .exceptions import error_for
   r = generate_fake_error_response('{"message": "Requires username/password authentication"}')
   raise error_for(r)
 return auth_wrapper

def requires_app_credentials ( func ) : @ wraps ( func ) def auth_wrapper ( self , * args , ** kwargs ) : ( client_id , client_secret ) = self . session . retrieve_client_credentials ( ) if ( client_id and client_secret ) : return func ( self , * args , ** kwargs ) else : from . exceptions import error_for r = generate_fake_error_response ( '{"message": "Requires username/password authentication"}' ) raise error_for ( r ) return auth_wrapper
require client_id and client_secret to be associated .