

def generate_stats(self, request, response):
    template_context = []
    for template_data in self.templates:
        info = {
            
        }
        template = template_data.get('template', None)
        if (hasattr(template, 'origin') and template.origin and template.origin.name):
            template.origin_name = template.origin.name
        else:
            template.origin_name = _('No origin')
        info['template'] = template
        if self.toolbar.config['SHOW_TEMPLATE_CONTEXT']:
            context_list = template_data.get('context', [])
            info['context'] = '\n'.join(context_list)
        template_context.append(info)
    if self.templates:
        context_processors = self.templates[0]['context_processors']
    else:
        context_processors = None
    template_dirs = get_template_dirs()
    self.record_stats({
        'templates': template_context,
        'template_dirs': [normpath(x) for x in template_dirs],
        'context_processors': context_processors,
    })

dataset/ETHPy150Open django-debug-toolbar/django-debug-toolbar/debug_toolbar/panels/templates/panel.py TemplatesPanel.generate_stats/original