#NEWLINE# def load_user_from_request( request ) : #NEWLINE# #INDENT# '\n    Load user from OAuth2 Authentication header.\n    ' #NEWLINE# user = None #NEWLINE# if hasattr ( oauth , 'oauth' ) : #NEWLINE# #INDENT# user = request . oauth . user #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ( is_valid , oauth ) = oauth2 . verify_request ( scopes = [ ] ) #NEWLINE# if is_valid : #NEWLINE# #INDENT# user = oauth . user #NEWLINE# #UNINDENT# #UNINDENT# return user