@@ -27,17 +27,17 @@ class DatastoreGrpcTransport(object):
2727 which can be used to take advantage of advanced
2828 features of gRPC.
2929 """
30+
3031 # The scopes needed to make gRPC calls to all of the methods defined
3132 # in this service.
3233 _OAUTH_SCOPES = (
33- ' https://www.googleapis.com/auth/cloud-platform' ,
34- ' https://www.googleapis.com/auth/datastore' ,
34+ " https://www.googleapis.com/auth/cloud-platform" ,
35+ " https://www.googleapis.com/auth/datastore" ,
3536 )
3637
37- def __init__ (self ,
38- channel = None ,
39- credentials = None ,
40- address = 'datastore.googleapis.com:443' ):
38+ def __init__ (
39+ self , channel = None , credentials = None , address = "datastore.googleapis.com:443"
40+ ):
4141 """Instantiate the transport class.
4242
4343 Args:
@@ -55,28 +55,21 @@ def __init__(self,
5555 # exception (channels come with credentials baked in already).
5656 if channel is not None and credentials is not None :
5757 raise ValueError (
58- ' The `channel` and `credentials` arguments are mutually '
59- 'exclusive.' , )
58+ " The `channel` and `credentials` arguments are mutually " "exclusive."
59+ )
6060
6161 # Create the channel.
6262 if channel is None :
63- channel = self .create_channel (
64- address = address ,
65- credentials = credentials ,
66- )
63+ channel = self .create_channel (address = address , credentials = credentials )
6764
6865 self ._channel = channel
6966
7067 # gRPC uses objects called "stubs" that are bound to the
7168 # channel and provide a basic method for each RPC.
72- self ._stubs = {
73- 'datastore_stub' : datastore_pb2_grpc .DatastoreStub (channel ),
74- }
69+ self ._stubs = {"datastore_stub" : datastore_pb2_grpc .DatastoreStub (channel )}
7570
7671 @classmethod
77- def create_channel (cls ,
78- address = 'datastore.googleapis.com:443' ,
79- credentials = None ):
72+ def create_channel (cls , address = "datastore.googleapis.com:443" , credentials = None ):
8073 """Create and return a gRPC channel object.
8174
8275 Args:
@@ -91,9 +84,7 @@ def create_channel(cls,
9184 grpc.Channel: A gRPC channel object.
9285 """
9386 return google .api_core .grpc_helpers .create_channel (
94- address ,
95- credentials = credentials ,
96- scopes = cls ._OAUTH_SCOPES ,
87+ address , credentials = credentials , scopes = cls ._OAUTH_SCOPES
9788 )
9889
9990 @property
@@ -116,7 +107,7 @@ def lookup(self):
116107 deserialized request object and returns a
117108 deserialized response object.
118109 """
119- return self ._stubs [' datastore_stub' ].Lookup
110+ return self ._stubs [" datastore_stub" ].Lookup
120111
121112 @property
122113 def run_query (self ):
@@ -129,7 +120,7 @@ def run_query(self):
129120 deserialized request object and returns a
130121 deserialized response object.
131122 """
132- return self ._stubs [' datastore_stub' ].RunQuery
123+ return self ._stubs [" datastore_stub" ].RunQuery
133124
134125 @property
135126 def begin_transaction (self ):
@@ -142,7 +133,7 @@ def begin_transaction(self):
142133 deserialized request object and returns a
143134 deserialized response object.
144135 """
145- return self ._stubs [' datastore_stub' ].BeginTransaction
136+ return self ._stubs [" datastore_stub" ].BeginTransaction
146137
147138 @property
148139 def commit (self ):
@@ -156,7 +147,7 @@ def commit(self):
156147 deserialized request object and returns a
157148 deserialized response object.
158149 """
159- return self ._stubs [' datastore_stub' ].Commit
150+ return self ._stubs [" datastore_stub" ].Commit
160151
161152 @property
162153 def rollback (self ):
@@ -169,7 +160,7 @@ def rollback(self):
169160 deserialized request object and returns a
170161 deserialized response object.
171162 """
172- return self ._stubs [' datastore_stub' ].Rollback
163+ return self ._stubs [" datastore_stub" ].Rollback
173164
174165 @property
175166 def allocate_ids (self ):
@@ -183,7 +174,7 @@ def allocate_ids(self):
183174 deserialized request object and returns a
184175 deserialized response object.
185176 """
186- return self ._stubs [' datastore_stub' ].AllocateIds
177+ return self ._stubs [" datastore_stub" ].AllocateIds
187178
188179 @property
189180 def reserve_ids (self ):
@@ -197,4 +188,4 @@ def reserve_ids(self):
197188 deserialized request object and returns a
198189 deserialized response object.
199190 """
200- return self ._stubs [' datastore_stub' ].ReserveIds
191+ return self ._stubs [" datastore_stub" ].ReserveIds
0 commit comments