MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _set_bases

Method _set_bases

tensorflow/tools/docs/parser.py:1072–1099  ·  view source on GitHub ↗

Builds the `bases` attribute, to document this class' parent-classes. This method sets the `bases` to a list of `_LinkInfo` objects point to the doc pages for the class' parents. Args: relative_path: The relative path from the doc this object describes to the documentatio

(self, relative_path, parser_config)

Source from the content-addressed store, hash-verified

1070 return self._bases
1071
1072 def _set_bases(self, relative_path, parser_config):
1073 """Builds the `bases` attribute, to document this class' parent-classes.
1074
1075 This method sets the `bases` to a list of `_LinkInfo` objects point to the
1076 doc pages for the class' parents.
1077
1078 Args:
1079 relative_path: The relative path from the doc this object describes to
1080 the documentation root.
1081 parser_config: An instance of `ParserConfig`.
1082 """
1083 bases = []
1084 obj = parser_config.py_name_to_object(self.full_name)
1085 for base in obj.__bases__:
1086 base_full_name = parser_config.reverse_index.get(id(base), None)
1087 if base_full_name is None:
1088 continue
1089 base_doc = _parse_md_docstring(base, relative_path,
1090 parser_config.reference_resolver)
1091 base_url = parser_config.reference_resolver.reference_to_url(
1092 base_full_name, relative_path)
1093
1094 link_info = _LinkInfo(short_name=base_full_name.split('.')[-1],
1095 full_name=base_full_name, obj=base,
1096 doc=base_doc, url=base_url)
1097 bases.append(link_info)
1098
1099 self._bases = bases
1100
1101 @property
1102 def properties(self):

Callers 1

Calls 7

_parse_md_docstringFunction · 0.85
_LinkInfoClass · 0.85
py_name_to_objectMethod · 0.80
reference_to_urlMethod · 0.80
getMethod · 0.45
splitMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected