<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def do_get_pages_with_tag(parser, token):
 """ Return Pages with given tag Syntax:: {% get_pages_with_tag <tag name> as <varname> %} Example use: {% get_pages_with_tag "footer" as pages %} """

    bits = token.split_contents()
    if 4 != len(bits):
        raise TemplateSyntaxError('%r expects 2 arguments' % bits[0])
    if bits[-2] != 'as':
        raise TemplateSyntaxError(
            '%r expects "as" as the second last argument' % bits[0])
    varname = bits[-1]
    tag = parser.compile_filter(bits[1])
    varname = bits[-1]
    return GetPagesWithTagNode(tag, varname)