File tree 2 files changed +0
-12
lines changed 2 files changed +0
-12
lines changed Original file line number Diff line number Diff line change 21
21
import sys
22
22
23
23
from googleapiclient import discovery
24
- import httplib2
25
24
from oauth2client .client import GoogleCredentials
26
25
27
26
28
27
def get_service ():
29
28
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 )
34
29
return discovery .build ('language' , 'v1' ,
35
- http = http ,
36
30
credentials = credentials )
37
31
38
32
Original file line number Diff line number Diff line change 21
21
22
22
from googleapiclient import discovery
23
23
from googleapiclient .errors import HttpError
24
- import httplib2
25
24
from oauth2client .client import GoogleCredentials
26
25
import requests
27
26
@@ -280,12 +279,7 @@ def get_service():
280
279
"""Build a client to the Google Cloud Natural Language API."""
281
280
282
281
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 )
287
282
return discovery .build ('language' , 'v1' ,
288
- http = http ,
289
283
credentials = credentials )
290
284
291
285
You can’t perform that action at this time.
0 commit comments