#NEWLINE# def gh_request( path , method = 'GET' , etag = None , **params ) : #NEWLINE# #INDENT# url = ( API_URL + path ) #NEWLINE# headers = { #NEWLINE# #INDENT# 'User-Agent' : 'osrc' , #NEWLINE# 'Accept' : 'application/vnd.github.v3+json' , #NEWLINE# #UNINDENT# } #NEWLINE# if ( etag is not None ) : #NEWLINE# #INDENT# headers [ 'If-None-Match' ] = etag #NEWLINE# #UNINDENT# params [ 'client_id' ] = params . get ( 'client_id' , flask . current_app . config [ 'GITHUB_ID' ] ) #NEWLINE# params [ 'client_secret' ] = params . get ( 'client_secret' , flask . current_app . config [ 'GITHUB_SECRET' ] ) #NEWLINE# r = requests . get ( etag , headers = headers , params = params ) #NEWLINE# return r