Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion tools/tensorflow_docs/api_generator/doc_controls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down Expand Up @@ -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)


Expand Down Expand Up @@ -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)


Expand Down