0
  6   ˆl–Ãa¾”Ò~êqA3pOÜÅ£�þB gr>GZlm¹üÿÃƒh¹ÂÁÀ      1
  $   H403239_•I|¥‰ÓMjqØ‚¦ ë<óo¬ÃÂ  ï    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access this resource.</p>
</body></html>
  5   	ˆl–Ãa¾”Ò~êqA3p\mµ1hß�þB gr6Ð ÀÿóÆƒh¹ÅÄÃ      	1
  /   ˆ{‹„„-i[D<†ªoZƒ›Ù«Ç597_‘I|¥‰ÓMdœv ©ƒ†ü+=ÇÆ U    ‹      Õ–ßoÚ0ÇßûWx~Ø�¶SiðÔ¤¡QŠZ¦iš¦ÊÄ†XMìÈ60ú×ÏÁi›NE£Tôé|É7w÷qÎ?ÂÑUwüsÔC_Ç—4úþeÐï"\øÑêDãÈ¿8®7€Þ#œX›·–Ëe}Ùª+=ƒñ5$6K�ÁX-b[g–arÏÈ
N™³(´Â¦œô%ã�š"Pskãî»•Æ"æ¦[žAÆ3¥W¥	Z' ã�Ò?;}æA>¶Ëeºp¢Øª¨"ØSFxE'ëÄÅP“Ð&hAS1“lUŽI(²2:î`±’&)•wõ™˜bDSÛÁ¿úÝ«ßN6)¾&!E‰æÓþÜíÏ¯:&CšñèËšK§¹Àd@�E™bb*8Û(¾ñâq¿9`ä57±¹J>IÁ!VQc•šœ:ÖG�èªÊKØÿfƒÆÏ&ctqÝŽ£þµŸV„xªnÿ“Õ\Z	Ícë^•t>ÕG91ùùƒ‹ÊÚµ˜%„jèEå+€§*e\W‘7Á>ÔëmµÊÊj6š§µ ¨g(øÔnœ"´ÇúçòNª¥¬¸~x@ÉTHŽ‰·[ 4Ôh´›Í� núö† y²2·¾Ë0©8ïEû`I²
Èö‹"WK®Ý¢ðvõ¿ñ¢Ðn;ZG&�ÃCù¯À0–Z‡°6‡Rþö]dæ“òÐp�ãw¸ÅÎùÂ�e˜x»€7î£"»½W’L*Îþ{jË[”÷»Ö÷Éü­ö/ N8    5   ˆl–Ãa¾”Ò~êqA
àŸ¸Ð”Å£�þB gd#¤+„mïçÊƒh¹ÉÈÇ      1
  B   ˆl–Ðz¾””ËmJ‚fà™¸)‹Fÿ�þBãn¬ØÞ�§œïà?ËƒmÐ¿Ê_ŠI|¥�+Wé3ž¯ÊÉ W    """A collection of modules for iterating through different kinds of
tree, generating tokens identical to those produced by the tokenizer
module.

To create a tree walker for a new type of tree, you need to
implement a tree walker object (called TreeWalker by convention) that
implements a 'serialize' method which takes a tree as sole argument and
returns an iterator which generates tokens.
"""

from __future__ import absolute_import, division, unicode_literals

from .. import constants
from .._utils import default_etree

__all__ = ["getTreeWalker", "pprint"]

treeWalkerCache = {}


def getTreeWalker(treeType, implementation=None, **kwargs):
    """Get a TreeWalker class for various types of tree with built-in support

    :arg str treeType: the name of the tree type required (case-insensitive).
        Supported values are:

        * "dom": The xml.dom.minidom DOM implementation
        * "etree": A generic walker for tree implementations exposing an
          elementtree-like interface (known to work with ElementTree,
          cElementTree and lxml.etree).
        * "lxml": Optimized walker for lxml.etree
        * "genshi": a Genshi stream

    :arg implementation: A module implementing the tree type e.g.
        xml.etree.ElementTree or cElementTree (Currently applies to the "etree"
        tree type only).

    :arg kwargs: keyword arguments passed to the etree walker--for other
        walkers, this has no effect

    :returns: a TreeWalker class

    """

    treeType = treeType.lower()
    if treeType not in treeWalkerCache:
        if treeType == "dom":
            from . import dom
            treeWalkerCache[treeType] = dom.TreeWalker
        elif treeType == "genshi":
            from . import genshi
            treeWalkerCache[treeType] = genshi.TreeWalker
        elif treeType == "lxml":
            from . import etree_lxml
            treeWalkerCache[treeType] = etree_lxml.TreeWalker
        elif treeType == "etree":
            from . import etree
            if implementation is None:
                implementation = default_etree
            # XXX: NEVER cache here, caching is done in the etree submodule
            return etree.getETreeModule(implementation, **kwargs).TreeWalker
    return treeWalkerCache.get(treeType)


def concatenateCharacterTokens(tokens):
    pendingCharacters = []
    for token in tokens:
        type = token["type"]
        if type in ("Characters", "SpaceCharacters"):
            pendingCharacters.append(token["data"])
        else:
            if pendingCharacters:
                yield {"type": "Characters", "data": "".join(pendingCharacters)}
                pendingCharacters = []
            yield token
    if pendingCharacters:
        yield {"type": "Characters", "data": "".join(pendingCharacters)}


def pprint(walker):
    """Pretty p