e40b2c0fbdbd932be5f9d0550a16b6652de0d38d,debug_toolbar/panels/template.py,TemplateDebugPanel,content,#TemplateDebugPanel#,47

Before Change


        return ""

    def content(self):
        templates = [
            (t.name, t.origin and t.origin.name or "No origin")
            for t in self.templates_used
        ]
        context = {
            "templates": templates,
            "template_dirs": settings.TEMPLATE_DIRS,
        }

After Change



    def content(self):
        template_context = []
        for i, d in enumerate(self.templates):
            info = {}
            // Clean up some info about templates
            t = d.get("template", None)
            if t.origin and t.origin.name:
                t.origin_name = t.origin.name
            else:
                t.origin_name = "No origin"
            info["template"] = t
            // Clean up context for better readability
            c = d.get("context", None)
            info["context"] = "\n".join([_d.__repr__() for _d in c.dicts])
            template_context.append(info)
        context = {
            "templates": template_context,
            "template_dirs": settings.TEMPLATE_DIRS,
        }
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: jazzband/django-debug-toolbar
Commit Name: e40b2c0fbdbd932be5f9d0550a16b6652de0d38d
Time: 2008-09-18
Author: rhudson@orcasinc.com
File Name: debug_toolbar/panels/template.py
Class Name: TemplateDebugPanel
Method Name: content


Project Name: scikit-learn-contrib/imbalanced-learn
Commit Name: 153f6e0ff5729fc22b68d5f6e0fd05edf96d8c2c
Time: 2019-11-17
Author: g.lemaitre58@gmail.com
File Name: examples/datasets/plot_make_imbalance.py
Class Name:
Method Name:


Project Name: pysb/pysb
Commit Name: 1246be72cd69352c8656f7dd4c7ede32ad413aa8
Time: 2013-03-11
Author: bachmanjohn@gmail.com
File Name: pysb/exporters/matlab.py
Class Name: ExportMatlab
Method Name: export