diff --git a/tools/tensorflow_docs/api_generator/doc_controls.py b/tools/tensorflow_docs/api_generator/doc_controls.py index ec8e0e862f..9a0fea0b4b 100644 --- a/tools/tensorflow_docs/api_generator/doc_controls.py +++ b/tools/tensorflow_docs/api_generator/doc_controls.py @@ -27,6 +27,14 @@ def set_deprecated(obj: T) -> T: def is_deprecated(obj) -> bool: + """Check whether an object is marked as deprecated. + + Args: + obj: The object to check. + + Returns: + True if the object is marked as deprecated, otherwise False. + """ return hasattr(obj, _DEPRECATED) @@ -86,7 +94,14 @@ def set_custom_page_builder_cls(obj, cls): def get_custom_page_builder_cls(obj): - """Gets custom page content if available.""" + """Return the custom page builder class for an object if set. + +Args: + obj: The object to inspect. + +Returns: + The custom page builder class if available, otherwise None. +""" return getattr(obj, _CUSTOM_PAGE_BUILDER_CLS, None) @@ -347,6 +362,14 @@ def _private(self): def should_doc_private(obj) -> bool: + """Check whether a private object should be documented. + +Args: + obj: The object to check. + +Returns: + True if the object is marked for documentation, otherwise False. +""" return hasattr(obj, _DOC_PRIVATE)