

def decorator_tag(self, func=None, takes_context=False):
    if (func is None):
        return partial(self.decorator_tag, takes_context=takes_context)
    name = func.__name__
    (params, varargs, varkw, defaults) = inspect.getargspec(func)

    def _compile(parser, token):
        nodelist = parser.parse((('end' + name),))
        parser.delete_first_token()
        bits = token.split_contents()[1:]
        (args, kwargs) = parse_bits(parser, bits, params, varargs, varkw, defaults, takes_context=takes_context, name=name)
        return CachedNode(func, takes_context, args, kwargs, nodelist)
    self.tag(name=name, compile_function=_compile)
    return func

dataset/ETHPy150Open Suor/django-cacheops/cacheops/templatetags/cacheops.py CacheopsLibrary.decorator_tag/original