#NEWLINE# def get_repo( fullname ) : #NEWLINE# #INDENT# repo = Repo . query . filter ( ( func . lower ( Repo . fullname ) == func . lower ( fullname ) ) ) . order_by ( Repo . id . desc ( ) ) . first ( ) #NEWLINE# etag = ( None if ( repo is None ) else repo . etag ) #NEWLINE# r = gh_request ( '/repos/{0}' . format ( fullname ) , etag = etag ) #NEWLINE# if ( r . status_code == 304 ) : #NEWLINE# #INDENT# return repo #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( r . status_code != requests . codes . ok ) : #NEWLINE# #INDENT# flask . abort ( r . status_code ) #NEWLINE# #UNINDENT# #UNINDENT# user = process_repo ( r . json ( ) , etag = r . headers [ 'ETag' ] ) #NEWLINE# db . session . commit ( ) #NEWLINE# return user