Visitor interface, see `traverse` for details.
(self, path, parent, children)
| 117 | name in self._do_not_descend_map[path]) |
| 118 | |
| 119 | def __call__(self, path, parent, children): |
| 120 | """Visitor interface, see `traverse` for details.""" |
| 121 | |
| 122 | # Avoid long waits in cases of pretty unambiguous failure. |
| 123 | if tf_inspect.ismodule(parent) and len(path.split('.')) > 10: |
| 124 | raise RuntimeError('Modules nested too deep:\n%s.%s\n\nThis is likely a ' |
| 125 | 'problem with an accidental public import.' % |
| 126 | (self._root_name, path)) |
| 127 | |
| 128 | # Includes self._root_name |
| 129 | full_path = '.'.join([self._root_name, path]) if path else self._root_name |
| 130 | |
| 131 | # Remove things that are not visible. |
| 132 | for name, child in list(children): |
| 133 | if self._is_private(full_path, name, child): |
| 134 | children.remove((name, child)) |
| 135 | |
| 136 | self._visitor(path, parent, children) |
| 137 | |
| 138 | # Remove things that are visible, but which should not be descended into. |
| 139 | for name, child in list(children): |
| 140 | if self._do_not_descend(full_path, name): |
| 141 | children.remove((name, child)) |
nothing calls this directly
no test coverage detected