@register.tag
def get_unread_message_count_between(parser, token):
    """
    Returns the unread message count between two users.

    Syntax::

        {% get_unread_message_count_between [user] and [user] as [var_name] %}

    Example usage::

        {% get_unread_message_count_between funky and wunki as message_count %}

    """
    try:
        tag_name, arg = token.contents.split(None, 1)
    except ValueError:
        raise template.TemplateSyntaxError("%s tag requires arguments" % token.contents.split()[0])
    m = re.search(r'(.*?) and (.*?) as (\w+)', arg)
    if not m:
        raise template.TemplateSyntaxError("%s tag had invalid arguments" % tag_name)
    um_from_user, um_to_user, var_name = m.groups()
    return MessageCount(um_from_user, var_name, um_to_user)
dataset/ETHPy150Open bread-and-pepper/django-userena/userena/contrib/umessages/templatetags/umessages_tags.py/get_unread_message_count_between/original