#NEWLINE# def authenticate_with_google( self ) : #NEWLINE# #INDENT# flow = flow_from_clientsecrets ( os . path . join ( os . path . dirname ( __file__ ) , 'resources/client_secrets.json' ) , scope = 'https://www.googleapis.com/auth/bigquery' ) #NEWLINE# storage = Storage ( self . credentials_filepath ) #NEWLINE# credentials = storage . get ( ) #NEWLINE# http = httplib2 . Http ( ) #NEWLINE# if ( ( credentials is None ) or credentials . invalid ) : #NEWLINE# #INDENT# credentials = run_flow ( flow = flow , storage = storage , flags = GoogleAPIAuthConfig , http = http ) #NEWLINE# self . logger . info ( 'Successfully authenticated with Google, moving on to building query.' ) #NEWLINE# #UNINDENT# http = credentials . authorize ( http ) #NEWLINE# return build ( 'bigquery' , 'v2' , http = http )