def render(self, context):
        params = {}
        if self.base_params is not None:
            params = self.base_params.resolve(context)
        if isinstance(params, basestring):
            try:
                presets = settings.CAIROTEXT_PRESETS
                params = dict(presets[params])
            except (AttributeError, KeyError):
                raise KeyError('Preset "%s" not found in '
                               'settings.CAIROTEXT_PRESETS' % params)
        params.update(dict((key, val.resolve(context))
                           for key, val in self.overrides.items()))
        text = self.text.resolve(context)
        name = md5(text.encode('UTF-8') + pformat(params)).hexdigest()
        render_dir = getattr(settings, 'CAIROTEXT_DIR', 'cairotext_cache')
        filename = name % '%s.png'
        fileurl = urljoin(settings.MEDIA_URL, join(render_dir, filename))
        filepath = join(settings.MEDIA_ROOT, render_dir, filename)
        size = None
        if not exists(filepath):
            size = render_text(text, filepath, params)
        pngsize = get_png_size(filepath)
        assert size is None or size == pngsize, \
            'size mismatch: expected %rx%r, got %rx%r' % (size+pngsize)

        context[self.varname] = TextImage(fileurl, filepath, pngsize)
        return ''
dataset/ETHPy150Open akaihola/django-cairo-text/cairotext/templatetags/cairotext.py/GetTextImageNode.render/swapped operands of `%`