#NEWLINE# def authorize( client_id = None , client_secret = None , client_email = None , private_key = None , save = False , identity = None , prefix = None , suffix = None ) : #NEWLINE# #INDENT# base_credentials = oauth . Credentials . find ( valid = True , interactive = True , identity = identity , client_id = client_id , client_secret = client_secret , client_email = client_email , private_key = private_key , prefix = prefix , suffix = suffix ) #NEWLINE# if base_credentials . incomplete : #NEWLINE# #INDENT# credentials = oauth . authorize ( base_credentials . client_id , base_credentials . client_secret ) #NEWLINE# credentials . identity = base_credentials . identity #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# credentials = base_credentials #NEWLINE# #UNINDENT# if save : #NEWLINE# #INDENT# keyring . set ( credentials . identity , credentials . serialize ( ) ) #NEWLINE# #UNINDENT# return prefix