02c9a52f65a0ddf73fbbb1d9b0e5d75ef756bad8,django/comicsite/templatetags/template_tags.py,VisualizationNode,render,#VisualizationNode#Any#,301
Before Change
return makeErrorMsgHtml(errormsg)
def render(self, context):
htmlOut =
<div id="comicViewer%(id)d" style="width:%(w)spx; height:%(h)spx"></div>
<script type="text/javascript">
var fmeViewer%(id)d = null;
$(document).ready(function (){
fmeViewer%(id)d = new ComicViewer2D("comicViewer%(id)d", {"deferredLoad":%(deferredLoad)s, "extensionFilter":"%(extensionFilter)s", "showBrowser":%(showBrowser)s});
fmeViewer%(id)d.init(function() {
fmeViewer%(id)d.setDataRoot("%(path)s");
});
});
</script>
% ({"id": id(self),
"path": self.args.get("dataset"),
"w": self.args.get("width", "300"),
"h": self.args.get("height", "300"),
"extensionFilter": self.args.get("extensionFilter", ""),
"deferredLoad": self.args.get("deferredLoad", "0"),
"showBrowser": self.args.get("showBrowser", "1")})
return htmlOut
@register.tag(name = "dropbox")
After Change
def render(self, context):
if self.safe_check("1","comicWorkstation",self.args):
return self.render_comic_workstation(context)
else:
return self.render_comic_viewer(context)
def safe_check(self,value,key,list):
Is there a cleaner way to do this?
if key in list:
if list[key] == value:
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: comic/grand-challenge.org
Commit Name: 02c9a52f65a0ddf73fbbb1d9b0e5d75ef756bad8
Time: 2013-04-03
Author: w.s.kerkstra@gmail.com
File Name: django/comicsite/templatetags/template_tags.py
Class Name: VisualizationNode
Method Name: render
Project Name: comic/grand-challenge.org
Commit Name: 5af8caab8783fe76552214649ff4fc6973037e18
Time: 2013-04-03
Author: w.s.kerkstra@gmail.com
File Name: django/comicsite/templatetags/template_tags.py
Class Name: VisualizationNode
Method Name: render
Project Name: keras-team/keras
Commit Name: 3b440235e237ef59ec5763c413e7f4292dab5d79
Time: 2018-04-26
Author: francois.chollet@gmail.com
File Name: keras/engine/network.py
Class Name: Network
Method Name: compute_mask