MCPcopy Index your code
hub / github.com/aymericdamien/TopDeepLearning / build_table

Function build_table

scripts/generate_stats.py:108–122  ·  view source on GitHub ↗
(results_list)

Source from the content-addressed store, hash-verified

106 return [r for r in results if r['stars'] >= 1000]
107
108def build_table(results_list):
109
110 def build_html_fields(d):
111 return ['<a href="%s">%s</a>' % (d['url'], d['title'].split('/')[-1]), d['stars_unparsed'], d['desc']]
112
113 def build_md_fields(d):
114 return ['[%s](%s)' % (d['title'].split('/')[-1], d['url']), d['stars_unparsed'], d['desc']]
115
116 html = '<table><thead><tr><td>Project Name</td><td>Stars</td><td>Description</td></tr></thead>'
117 md = '| Project Name | Stars | Description |\n| ------- | ------ | ------ |\n'
118 for r in results_list:
119 html += '<tr><td>' + '</td><td>'.join(build_html_fields(r)) + '</td></tr>'
120 md += '|' + '|'.join(build_md_fields(r)) + '|\n'
121 html += '</table>'
122 return html, md
123
124topics = get_topic(['tensorflow', 'deep-learning', 'pytorch', 'machine-learning'], n_pages=15)
125searches = search(['tensorflow', 'deep learning', 'pytorch', 'cntk', 'machine learning'], n_pages=15)

Callers 1

generate_stats.pyFile · 0.85

Calls 2

build_html_fieldsFunction · 0.85
build_md_fieldsFunction · 0.85

Tested by

no test coverage detected