def do_get_latest_comments(parser, token):
    """
    Gets the latest comments by date_submitted.
    """
    error_message = "%r tag must be of format {%% %r NUM_TO_GET as CONTEXT_VARIABLE %%}" % (token.contents.split()[0], token.contents.split()[0])
    try:
        split = token.split_contents()
    except __HOLE__:
        raise template.TemplateSyntaxError, error_message
    if len(split) != 4:
        raise template.TemplateSyntaxError, error_message
    if split[2] != 'as':
        raise template.TemplateSyntaxError, error_message
    if "free" in split[0]:
        is_free = True
    else:
        is_free = False
    return LatestCommentsNode(split[1], split[3], free=is_free)
dataset/ETHPy150Open caseywstark/colab/colab/apps/threadedcomments/templatetags/threadedcommentstags.py/do_get_latest_comments