b0b466618f669f87ecfe66b9dd655415ba88ed83,imagekit/templatetags/imagekit_tags.py,SpecNode,render,#SpecNode#Any#,16

Before Change


        from ..utils import autodiscover
        autodiscover()
        source_image = self.source_image.resolve(context)
        spec_id = self.spec_id.resolve(context)
        spec = specs.registry.get_spec(spec_id)
        if callable(spec):
            spec = spec()
        file = ImageSpecCacheFile(spec, source_image)
        if self.variable_name is not None:
            variable_name = str(self.variable_name)
            context[variable_name] = file
            return ""

        return mark_safe(u"<img src="%s" />" % file.url)

After Change


    def render(self, context):
        file = self.get_file(context)
        attrs = self.get_html_attrs(context)
        attr_dict = dict(attrs)
        if not "width" in attr_dict and not "height" in attr_dict:
            attrs = attrs + [("width", ""%s"" % file.width),
                             ("height", ""%s"" % file.height)]
        attrs = [("src", ""%s"" % file.url)] + attrs
        attr_str = " ".join(self.get_attr_str(k, v) for k, v in attrs)
        return mark_safe(u"<img %s />" % attr_str)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: matthewwithanm/django-imagekit
Commit Name: b0b466618f669f87ecfe66b9dd655415ba88ed83
Time: 2012-10-17
Author: m@tthewwithanm.com
File Name: imagekit/templatetags/imagekit_tags.py
Class Name: SpecNode
Method Name: render


Project Name: comic/grand-challenge.org
Commit Name: b63886addf175201fe2d284c5267e232c670d3bf
Time: 2018-12-03
Author: jamesmeakin@gmail.com
File Name: app/grandchallenge/core/contextprocessors/contextprocessors.py
Class Name:
Method Name: comic_site


Project Name: tgsmith61591/pmdarima
Commit Name: 942f284052b22214d830c1bc2c8de03bffaa8d07
Time: 2020-02-18
Author: aaronreidsmith@gmail.com
File Name: build_tools/azure/render_meta.py
Class Name:
Method Name: