'Renders the compressor output with the appropriate template for
the given mode and template context.'

def render_output(self, mode, context=None):

    if (u'compressed' not in self.context):
        self.context[u'compressed'] = {}
    self.context[u'compressed'].update((context or {}))
    self.context[u'compressed'].update(self.extra_context)
    if (hasattr(self.context, u'flatten') and (VERSION >= (1, 9))):
        final_context = self.context.flatten()
    else:
        final_context = self.context
    post_compress.send(sender=self.__class__, type=self.type, mode=mode, context=final_context)
    template_name = self.get_template_name(mode)
    return render_to_string(template_name, context=final_context)
