File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121import sys
2222
2323from googleapiclient import discovery
24- import httplib2
2524from oauth2client .client import GoogleCredentials
2625
2726
2827def get_service ():
2928 credentials = GoogleCredentials .get_application_default ()
30- scoped_credentials = credentials .create_scoped (
31- ['https://www.googleapis.com/auth/cloud-platform' ])
32- http = httplib2 .Http ()
33- scoped_credentials .authorize (http )
3429 return discovery .build ('language' , 'v1' ,
35- http = http ,
3630 credentials = credentials )
3731
3832
Original file line number Diff line number Diff line change 2121
2222from googleapiclient import discovery
2323from googleapiclient .errors import HttpError
24- import httplib2
2524from oauth2client .client import GoogleCredentials
2625import requests
2726
@@ -280,12 +279,7 @@ def get_service():
280279 """Build a client to the Google Cloud Natural Language API."""
281280
282281 credentials = GoogleCredentials .get_application_default ()
283- scoped_credentials = credentials .create_scoped (
284- ['https://www.googleapis.com/auth/cloud-platform' ])
285- http = httplib2 .Http ()
286- scoped_credentials .authorize (http )
287282 return discovery .build ('language' , 'v1' ,
288- http = http ,
289283 credentials = credentials )
290284
291285
You can’t perform that action at this time.
0 commit comments