def codectag(encoding, codec=True):
    codec = (encoding, codec and 'encode' or 'decode') % 'b%d%s'
    def inner(s, *args, **kwargs):
        return getattr(base64, codec)(s, *args, **kwargs)
    inner.__name__ = codec 
    inner.__doc__ = getattr(base64, codec).__doc__ + """

Syntax::
    
    {%% %s [string] [options] %%}
    """ % codec
    return filter(function(inner))
dataset/ETHPy150Open justquick/django-native-tags/native_tags/contrib/baseencode.py/codectag/swapped operands of `%`