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

Function make_all

tensorflow/python/util/all_util.py:30–57  ·  view source on GitHub ↗

Generates `__all__` from the docstring of one or more modules. Usage: `make_all(__name__)` or `make_all(__name__, [sys.modules(__name__), other_module])`. The doc string modules must each a docstring, and `__all__` will contain all symbols with `@@` references, where that symbol currently e

(module_name, doc_string_modules=None)

Source from the content-addressed store, hash-verified

28
29
30def make_all(module_name, doc_string_modules=None):
31 """Generates `__all__` from the docstring of one or more modules.
32
33 Usage: `make_all(__name__)` or
34 `make_all(__name__, [sys.modules(__name__), other_module])`. The doc string
35 modules must each a docstring, and `__all__` will contain all symbols with
36 `@@` references, where that symbol currently exists in the module named
37 `module_name`.
38
39 Args:
40 module_name: The name of the module (usually `__name__`).
41 doc_string_modules: a list of modules from which to take docstring.
42 If None, then a list containing only the module named `module_name` is used.
43
44 Returns:
45 A list suitable for use as `__all__`.
46 """
47 if doc_string_modules is None:
48 doc_string_modules = [_sys.modules[module_name]]
49 cur_members = set([name for name, _
50 in _tf_inspect.getmembers(_sys.modules[module_name])])
51
52 results = set()
53 for doc_module in doc_string_modules:
54 results.update([m.group(1)
55 for m in _reference_pattern.finditer(doc_module.__doc__)
56 if m.group(1) in cur_members])
57 return list(results)
58
59# Hidden attributes are attributes that have been hidden by
60# `remove_undocumented`. They can be re-instated by `reveal_undocumented`.

Callers 3

__init__.pyFile · 0.90
nets.pyFile · 0.90
remove_undocumentedFunction · 0.85

Calls 2

updateMethod · 0.45
groupMethod · 0.45

Tested by

no test coverage detected