406574ef659338accb6a926a097099c1691ef8f3,create_website.py,,create_plot,#,136
Before Change
def create_plot(all_data, xn, yn, linestyle, j2_env, additional_label = "", plottype = "line"):
xm, ym = (metrics[xn], metrics[yn])
render_all_points = plottype == "bubble"
return {"xlabel" : xm["description"],
"ylabel" : ym["description"],
"plottype" : plottype,
"plotlabel" : get_plot_label(xm, ym),
"label": additional_label,
"datapoints" : create_data_points(all_data, xn, yn,
linestyle, render_all_points),
"buttonlabel" : hashlib.sha224((get_plot_label(xm, ym) +
additional_label).encode("utf-8")).hexdigest(),
"latexcode" : get_latex_plot(all_data, xn, yn, xm, ym, render_all_points, j2_env)}
def build_detail_site(data, label_func, j2_env):
for (name, runs) in data.items():
print("Building "%s"" % name)
After Change
def create_plot(all_data, xn, yn, linestyle, j2_env, additional_label = "", plottype = "line"):
xm, ym = (metrics[xn], metrics[yn])
render_all_points = plottype == "bubble"
plot_data = get_lines(all_data, xn, yn, render_all_points)
latex_code = j2_env.get_template("latex.template").\
render(plot_data = plot_data, caption = get_plot_label(xm, ym),
xlabel = xm["description"], ylabel = ym["description"])
plot_data = get_lines(all_data, xn, yn, render_all_points)
button_label = hashlib.sha224((get_plot_label(xm, ym) +
additional_label).encode("utf-8")).hexdigest()
return j2_env.get_template("chartjs.template").\
render(args = args, latex_code = latex_code, button_label = button_label,
data_points = plot_data,
xlabel = xm["description"], ylabel = ym["description"],
plottype = plottype, plot_label = get_plot_label(xm, ym),
label = additional_label, linestyle = linestyle,
render_all_points = render_all_points)
def build_detail_site(data, label_func, j2_env):
for (name, runs) in data.items():
print("Building "%s"" % name)

In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances
Project Name: erikbern/ann-benchmarks
Commit Name: 406574ef659338accb6a926a097099c1691ef8f3
Time: 2018-03-05
Author: maau@itu.dk
File Name: create_website.py
Class Name:
Method Name: create_plot
Project Name: erikbern/ann-benchmarks
Commit Name: c6418175813007be62406bfb35b42441202b017a
Time: 2018-03-03
Author: maau@itu.dk
File Name: create_website.py
Class Name:
Method Name: get_latex_plot
Project Name: jazzband/django-debug-toolbar
Commit Name: d85509edab8290666d056ba5f0a9423feceb64d5
Time: 2008-09-07
Author: rob@cogit8.org
File Name: debug_toolbar/panels/sql.py
Class Name: SQLDebugPanel
Method Name: content