@@ -94,7 +94,6 @@ def log_create_complete(
9494 resource (proto.Message):
9595 AI Platform Resourc proto.Message
9696 variable_name (str): Name of variable to use for code snippet
97-
9897 """
9998 self ._logger .info (f"{ cls .__name__ } created. Resource name: { resource .name } " )
10099 self ._logger .info (f"To use this { cls .__name__ } in another session:" )
@@ -181,7 +180,8 @@ def _raise_future_exception(self):
181180 raise self ._exception
182181
183182 def _complete_future (self , future : futures .Future ):
184- """Checks for exception of future and removes the pointer if it's still latest.
183+ """Checks for exception of future and removes the pointer if it's still
184+ latest.
185185
186186 Args:
187187 future (futures.Future): Required. A future to complete.
@@ -215,13 +215,14 @@ def wait(self):
215215
216216 @property
217217 def _latest_future (self ) -> Optional [futures .Future ]:
218- """Get the latest future if it exists"""
218+ """Get the latest future if it exists. """
219219 with self .__latest_future_lock :
220220 return self .__latest_future
221221
222222 @_latest_future .setter
223223 def _latest_future (self , future : Optional [futures .Future ]):
224- """Optionally set the latest future and add a complete_future callback."""
224+ """Optionally set the latest future and add a complete_future
225+ callback."""
225226 with self .__latest_future_lock :
226227 self .__latest_future = future
227228 if future :
@@ -260,7 +261,8 @@ def wait_for_dependencies_and_invoke(
260261 kwargs : Dict [str , Any ],
261262 internal_callbacks : Iterable [Callable [[Any ], Any ]],
262263 ) -> Any :
263- """Wrapper method to wait on any dependencies before submitting method.
264+ """Wrapper method to wait on any dependencies before submitting
265+ method.
264266
265267 Args:
266268 deps (Sequence[futures.Future]):
@@ -272,7 +274,6 @@ def wait_for_dependencies_and_invoke(
272274 Required. The keyword arguments to call the method with.
273275 internal_callbacks: (Callable[[Any], Any]):
274276 Callbacks that take the result of method.
275-
276277 """
277278
278279 for future in set (deps ):
@@ -342,12 +343,14 @@ def wait_for_dependencies_and_invoke(
342343 @classmethod
343344 @abc .abstractmethod
344345 def _empty_constructor (cls ) -> "FutureManager" :
345- """Should construct object with all non FutureManager attributes as None"""
346+ """Should construct object with all non FutureManager attributes as
347+ None."""
346348 pass
347349
348350 @abc .abstractmethod
349351 def _sync_object_with_future_result (self , result : "FutureManager" ):
350- """Should sync the object from _empty_constructor with result of future."""
352+ """Should sync the object from _empty_constructor with result of
353+ future."""
351354
352355 def __repr__ (self ) -> str :
353356 if self ._exception :
@@ -375,7 +378,8 @@ class AiPlatformResourceNoun(metaclass=abc.ABCMeta):
375378 @classmethod
376379 @abc .abstractmethod
377380 def client_class (cls ) -> Type [utils .AiPlatformServiceClientWithOverride ]:
378- """Client class required to interact with resource with optional overrides."""
381+ """Client class required to interact with resource with optional
382+ overrides."""
379383 pass
380384
381385 @property
@@ -388,7 +392,8 @@ def _is_client_prediction_client(cls) -> bool:
388392 @property
389393 @abc .abstractmethod
390394 def _getter_method (cls ) -> str :
391- """Name of getter method of client class for retrieving the resource."""
395+ """Name of getter method of client class for retrieving the
396+ resource."""
392397 pass
393398
394399 @property
@@ -400,7 +405,7 @@ def _delete_method(cls) -> str:
400405 @property
401406 @abc .abstractmethod
402407 def _resource_noun (cls ) -> str :
403- """Resource noun"""
408+ """Resource noun. """
404409 pass
405410
406411 def __init__ (
@@ -547,7 +552,8 @@ def optional_sync(
547552 return_input_arg : Optional [str ] = None ,
548553 bind_future_to_self : bool = True ,
549554):
550- """Decorator for AiPlatformResourceNounWithFutureManager with optional sync support.
555+ """Decorator for AiPlatformResourceNounWithFutureManager with optional sync
556+ support.
551557
552558 Methods with this decorator should include a "sync" argument that defaults to
553559 True. If called with sync=False this decorator will launch the method as a
@@ -681,7 +687,8 @@ def wrapper(*args, **kwargs):
681687
682688
683689class AiPlatformResourceNounWithFutureManager (AiPlatformResourceNoun , FutureManager ):
684- """Allows optional asynchronous calls to this AI Platform Resource Nouns."""
690+ """Allows optional asynchronous calls to this AI Platform Resource
691+ Nouns."""
685692
686693 def __init__ (
687694 self ,
@@ -816,7 +823,8 @@ def _list(
816823 credentials : Optional [auth_credentials .Credentials ] = None ,
817824 ) -> List [AiPlatformResourceNoun ]:
818825 """Private method to list all instances of this AI Platform Resource,
819- takes a `cls_filter` arg to filter to a particular SDK resource subclass.
826+ takes a `cls_filter` arg to filter to a particular SDK resource
827+ subclass.
820828
821829 Args:
822830 cls_filter (Callable[[proto.Message], bool]):
@@ -884,8 +892,9 @@ def _list_with_local_order(
884892 credentials : Optional [auth_credentials .Credentials ] = None ,
885893 ) -> List [AiPlatformResourceNoun ]:
886894 """Private method to list all instances of this AI Platform Resource,
887- takes a `cls_filter` arg to filter to a particular SDK resource subclass.
888- Provides client-side sorting when a list API doesn't support `order_by`.
895+ takes a `cls_filter` arg to filter to a particular SDK resource
896+ subclass. Provides client-side sorting when a list API doesn't support
897+ `order_by`.
889898
890899 Args:
891900 cls_filter (Callable[[proto.Message], bool]):
@@ -986,7 +995,8 @@ def list(
986995
987996 @optional_sync ()
988997 def delete (self , sync : bool = True ) -> None :
989- """Deletes this AI Platform resource. WARNING: This deletion is permament.
998+ """Deletes this AI Platform resource. WARNING: This deletion is
999+ permament.
9901000
9911001 Args:
9921002 sync (bool):
0 commit comments