def validate_token_parameters(params):
 if (u'error' in params):
  raise_from_error(params.get(u'error'), params)
 if (not (u'access_token' in params)):
  raise MissingTokenError(description=u'Missing access token parameter.')
 if (not (u'token_type' in params)):
  if os.environ.get(u'OAUTHLIB_STRICT_TOKEN_TYPE'):
   raise MissingTokenTypeError()
 if params.scope_changed:
  message = u'Scope has changed from "{old}" to "{new}".'.format(old=params.old_scope, new=params.scope)
  scope_changed.send(message=message, old=params.old_scopes, new=params.scopes)
  if (not os.environ.get(u'OAUTHLIB_RELAX_TOKEN_SCOPE', None)):
   w = Warning(message)
   w.token = params
   w.old_scope = params.old_scopes
   w.new_scope = params.scopes
   raise w

def validate_token_parameters ( params ) : if ( u'error' in params ) : raise_from_error ( params . get ( u'error' ) , params ) if ( not ( u'access_token' in params ) ) : raise MissingTokenError ( description = u'Missing access token parameter.' ) if ( not ( u'token_type' in params ) ) : if os . environ . get ( u'OAUTHLIB_STRICT_TOKEN_TYPE' ) : raise MissingTokenTypeError ( ) if params . scope_changed : message = u'Scope has changed from "{old}" to "{new}".' . format ( old = params . old_scope , new = params . scope ) scope_changed . send ( message = message , old = params . old_scopes , new = params . scopes ) if ( not os . environ . get ( u'OAUTHLIB_RELAX_TOKEN_SCOPE' , None ) ) : w = Warning ( message ) w . token = params w . old_scope = params . old_scopes w . new_scope = params . scopes raise w
ensures token precence .