def create_template_context(self, element, **kwargs):
        """Code generation context, specific to template and current element."""
        context = dict(element=element, **kwargs)
        if self.global_context:
            context.update(**self.global_context)
        return context
Code generation context, specific to template and current element.