code: def do_get_pages_with_tag(parser, token):
      
      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)
docs: Return Pages with given tag
  
      Syntax::
  
          {% get_pages_with_tag <tag name> as <varname> %}
  
      Example use:
          {% get_pages_with_tag "footer" as pages %}