9f221345e7a58804e347f2a1879b06922222413b,docs/md_autogen.py,MarkdownAPIGenerator,module2md,#MarkdownAPIGenerator#Any#,323
Before Change
modname = module.__name__
path = self.get_src_path(module, append_base=False)
path = "[{}]({})".format(path, os.path.join(self.github_link, path))
found = []
classes = []
line_nos = []
for name, obj in getmembers(module, inspect.isclass):
After Change
modname = module.__name__
path = self.get_src_path(module, append_base=False)
path = "[{}]({})".format(path, os.path.join(self.github_link, path))
found = set()
classes = []
line_nos = []
for name, obj in getmembers(module, inspect.isclass):
// handle classes
found.add(name)
if not name.startswith("_") and hasattr(obj, "__module__") and obj.__module__ == modname:
classes.append(self.class2md(obj))
line_nos.append(self.get_line_no(obj) or 0)
classes = order_by_line_nos(classes, line_nos)
// Since functions can have multiple aliases.
func2names = defaultdict(list)
for name, obj in getmembers(module, inspect.isfunction):
func2names[obj].append(name)
functions = []
line_nos = []
for obj in func2names:
names = func2names[obj]
found.update(names)
// Include if within module or included modules within __init__.py and exclude from global variables
is_module_within_init = "__init__.py" in path and obj.__module__.startswith(modname)
if is_module_within_init:
found.add(obj.__module__.replace(modname + ".", ""))
if hasattr(obj, "__module__") and (obj.__module__ == modname or is_module_within_init):
names = list(filter(lambda name: not name.startswith("_"), names))
if len(names) > 0:
functions.append(self.func2md(obj, names=names))
line_nos.append(self.get_line_no(obj) or 0)
functions = order_by_line_nos(functions, line_nos)
variables = []
line_nos = []
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 8
Instances
Project Name: raghakot/keras-vis
Commit Name: 9f221345e7a58804e347f2a1879b06922222413b
Time: 2017-07-03
Author: ragha@outlook.com
File Name: docs/md_autogen.py
Class Name: MarkdownAPIGenerator
Method Name: module2md
Project Name: bokeh/bokeh
Commit Name: f1bc5b054e29f6d8e948fe7222936a2b0a975535
Time: 2019-10-07
Author: mattpap@gmail.com
File Name: bokeh/util/compiler.py
Class Name:
Method Name: _bundle_models
Project Name: home-assistant/home-assistant
Commit Name: bfb5089ed59f1df8cf53a3b517ac6b091f539a26
Time: 2015-03-08
Author: andyt05@gmail.com
File Name: homeassistant/components/device_tracker/nmap_tracker.py
Class Name: NmapDeviceScanner
Method Name: _update_info
Project Name: raghakot/keras-vis
Commit Name: 9f221345e7a58804e347f2a1879b06922222413b
Time: 2017-07-03
Author: ragha@outlook.com
File Name: docs/md_autogen.py
Class Name: MarkdownAPIGenerator
Method Name: module2md