@register.tag(name="get_recent_stories")
def get_recent_stories(parser, token):
    """
    {% get_recent_stories [ids] limit as stories %}
    ids : optional or as 2,3
    limit: how many stories
    """
    bits = token.split_contents()
    len_bits = len(bits)
    if len_bits not in [4,5]:
        raise TemplateSyntaxError('%r expects 4 or 5 arguments' % bits[0])
    if bits[-2] != 'as':
        raise TemplateSyntaxError(
            '%r expects "as" as the third argument' % bits[0])
    categories = bits[1] if len_bits == 5 else None
    limit = bits[1] if len_bits == 4 else bits[2]
    varname = bits[-1]
    return get_recent_stories_node(limit, categories, varname)
dataset/ETHPy150Open zorna/zorna/zorna/articles/templatetags/articles_tags.py/get_recent_stories/original