ó
ä™L]c           @` s�  d  d l  m Z m Z m Z d  d l m Z m Z d  d l Z d  d l m	 Z	 d d l
 m Z d d l
 m Z d d l
 m Z d d	 l m Z d d
 l
 m Z d d l m Z m Z m Z m Z m Z m Z m Z m Z m Z m Z m Z m Z m Z m  Z  m! Z! m" Z" d e# d „ Z$ d d e# d „ Z% d „  Z& d e' f d „  ƒ  YZ( e j) d „  ƒ Z* d „  Z+ d e, e- d „ Z. d e/ f d „  ƒ  YZ0 d S(   i    (   t   absolute_importt   divisiont   unicode_literals(   t   with_metaclasst   viewkeysN(   t   OrderedDicti   (   t   _inputstream(   t
   _tokenizer(   t   treebuilders(   t   Marker(   t   _utils(   t   spaceCharacterst   asciiUpper2Lowert   specialElementst   headingElementst   cdataElementst   rcdataElementst
   tokenTypest   tagTokenTypest
   namespacest   htmlIntegrationPointElementst"   mathmlTextIntegrationPointElementst   adjustForeignAttributest   adjustMathMLAttributest   adjustSVGAttributest   Et   _ReparseExceptionu   etreec         K` s1   t  j | ƒ } t | d | ƒ} | j |  | � S(   uò  Parse an HTML document as a string or file-like object into a tree

    :arg doc: the document to parse as a string or file-like object

    :arg treebuilder: the treebuilder to use when parsing

    :arg namespaceHTMLElements: whether or not to namespace HTML elements

    :returns: parsed tree

    Example:

    >>> from html5lib.html5parser import parse
    >>> parse('<html><body><p>This is a doc</p></body></html>')
    <Element u'{http://www.w3.org/1999/xhtml}html' at 0x7feac4909db0>

    t   namespaceHTMLElements(   R   t   getTreeBuildert
   HTMLParsert   parse(   t   doct   treebuilderR   t   kwargst   tbt   p(    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR      s    u   divc         K` s7   t  j | ƒ } t | d | ƒ} | j |  d | | �S(   u#  Parse an HTML fragment as a string or file-like object into a tree

    :arg doc: the fragment to parse as a string or file-like object

    :arg container: the container context to parse the fragment in

    :arg treebuilder: the treebuilder to use when parsing

    :arg namespaceHTMLElements: whether or not to namespace HTML elements

    :returns: parsed tree

    Example:

    >>> from html5lib.html5libparser import parseFragment
    >>> parseFragment('<b>this is a fragment</b>')
    <Element u'DOCUMENT_FRAGMENT' at 0x7feac484b090>

    R   t	   container(   R   R   R   t   parseFragment(   R   R$   R    R   R!   R"   R#   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR%   2   s    c         ` s    d t  f ‡  f d †  ƒ  Y} | S(   Nt	   Decoratedc           ` s   e  Z ‡  f d  †  Z RS(   c         ` s^   xE | j  ƒ  D]7 \ } } t | t j ƒ r: ˆ  | ƒ } n  | | | <q Wt j |  | | | ƒ S(   N(   t   itemst
   isinstancet   typest   FunctionTypet   typet   __new__(   t   metat	   classnamet   basest	   classDictt   attributeNamet	   attribute(   t   function(    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR,   M   s
    (   t   __name__t
   __module__R,   (    (   R3   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR&   L   s   (   R+   (   R3   R&   (    (   R3   s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyt   method_decorator_metaclassK   s    R   c           B` sÑ   e  Z d  Z d e e e d „ Z e d e d „ Z d „  Z e	 d „  ƒ Z
 d „  Z d „  Z d „  Z d	 „  Z d
 „  Z d „  Z d d d „ Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   u]   HTML parser

    Generates a tree structure from a stream of (possibly malformed) HTML.

    c         C` s‰   | |  _  | d k r' t j d ƒ } n  | | ƒ |  _ g  |  _ t g  t | ƒ j ƒ  D]$ \ } } | | |  |  j ƒ f ^ qU ƒ |  _	 d S(   uÑ  
        :arg tree: a treebuilder class controlling the type of tree that will be
            returned. Built in treebuilders can be accessed through
            html5lib.treebuilders.getTreeBuilder(treeType)

        :arg strict: raise an exception when a parse error is encountered

        :arg namespaceHTMLElements: whether or not to namespace HTML elements

        :arg debug: whether or not to enable debug mode which logs things

        Example:

        >>> from html5lib.html5parser import HTMLParser
        >>> parser = HTMLParser()                     # generates parser with etree builder
        >>> parser = HTMLParser('lxml', strict=True)  # generates parser with lxml builder which is strict

        u   etreeN(
   t   strictt   NoneR   R   t   treet   errorst   dictt	   getPhasesR'   t   phases(   t   selfR9   R7   R   t   debugt   namet   cls(    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyt   __init__^   s    		u   divc         K` sz   | |  _  | |  _ | |  _ t j | d |  | �|  _ |  j ƒ  y |  j ƒ  Wn% t k
 ru |  j ƒ  |  j ƒ  n Xd  S(   Nt   parser(	   t   innerHTMLModeR$   t	   scriptingR   t   HTMLTokenizert	   tokenizert   resett   mainLoopR   (   R>   t   streamt	   innerHTMLR$   RE   R!   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyt   _parse}   s    			

c         C` s  |  j  j ƒ  t |  _ g  |  _ g  |  _ d |  _ |  j râ |  j j	 ƒ  |  _
 |  j
 t k rp |  j j |  j _ nH |  j
 t k r” |  j j |  j _ n$ |  j
 d k r¸ |  j j |  j _ n  |  j d |  _ |  j j ƒ  |  j ƒ  n t |  _
 |  j d |  _ d  |  _ d  |  _ t |  _ d  S(   Nu	   no quirksu	   plaintextu
   beforeHtmlu   initial(   R9   RH   t   Falset   firstStartTagR:   t   logt
   compatModeRD   R$   t   lowerRK   R   RG   t   rcdataStatet   stateR   t   rawtextStatet   plaintextStateR=   t   phaset   insertHtmlElementt   resetInsertionModeR8   t	   lastPhaset   beforeRCDataPhaset   Truet
   framesetOK(   R>   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRH   ‹   s*    								c         C` s'   t  |  d ƒ s d S|  j j j d j S(   u‡   Name of the character encoding that was used to decode the input stream, or
        :obj:`None` if that is not determined yet

        u	   tokenizeri    N(   t   hasattrR8   RG   RJ   t   charEncodingR@   (   R>   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyt   documentEncoding­   s    c         C` se   | j  d k rK | j t d k rK d | j k oJ | j d j t ƒ d k S| j | j  f t k Sd  S(   Nu   annotation-xmlu   mathmlu   encodingu	   text/htmlu   application/xhtml+xml(   u	   text/htmlu   application/xhtml+xml(   R@   t	   namespaceR   t
   attributest	   translateR   R   (   R>   t   element(    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyt   isHTMLIntegrationPoint·   s    c         C` s   | j  | j f t k S(   N(   R`   R@   R   (   R>   Rc   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyt   isMathMLTextIntegrationPointÁ   s    c         C` sB  t  d } t  d } t  d } t  d } t  d } t  d } t  d } xŸ|  j ƒ  D]‘} d  }	 | }
 x=|
 d  k	 r¤|
 }	 |  j j r– |  j j d n d  } | r« | j n d  } | rÀ | j n d  } |
 d	 } | | k r|  j |
 d
 |
 j d i  ƒ ƒ d  }
 qh t	 |  j j ƒ d k sÔ| |  j j
 k sÔ|  j | ƒ rx| | k rf| d t d d g ƒ k sÔ| | | f k sÔ| t d k r°| d k r°| | k r°| d d k sÔ|  j | ƒ rà| | | | f k rà|  j } n |  j d } | | k r| j |
 ƒ }
 qh | | k r)| j |
 ƒ }
 qh | | k rG| j |
 ƒ }
 qh | | k re| j |
 ƒ }
 qh | | k rƒ| j |
 ƒ }
 qh | | k rh | j |
 ƒ }
 qh qh W| | k rS |	 d rS |	 d rS |  j d i |	 d d 6ƒ qS qS Wt } g  } xG | r=| j |  j ƒ |  j j ƒ  } | r÷|  j | k s:t ‚ q÷q÷Wd  S(   Nu
   Charactersu   SpaceCharactersu   StartTagu   EndTagu   Commentu   Doctypeu
   ParseErroriÿÿÿÿu   typeu   datau   datavarsi    u   nameu   mglyphu
   malignmarku   mathmlu   annotation-xmlu   svgu   inForeignContentu   selfClosingu   selfClosingAcknowledgedu&   non-void-element-with-trailing-solidus(   R   t   normalizedTokensR8   R9   t   openElementsR`   R@   t
   parseErrort   gett   lent   defaultNamespaceRe   t	   frozensetR   Rd   RV   R=   t   processCharacterst   processSpaceCharacterst   processStartTagt   processEndTagt   processCommentt   processDoctypeR[   t   appendt
   processEOFt   AssertionError(   R>   t   CharactersTokent   SpaceCharactersTokent   StartTagTokent   EndTagTokent   CommentTokent   DoctypeTokent   ParseErrorTokent   tokent
   prev_tokent	   new_tokent   currentNodet   currentNodeNamespacet   currentNodeNameR+   RV   t	   reprocessR=   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRI   Ä   sp    






"
 			c         c` s&   x |  j  D] } |  j | ƒ Vq
 Wd  S(   N(   RG   t   normalizeToken(   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRf     s    c         O` s&   |  j  | t d | | Ž |  j j ƒ  S(   uî  Parse a HTML document into a well-formed tree

        :arg stream: a file-like object or string containing the HTML to be parsed

            The optional encoding parameter must be a string that indicates
            the encoding.  If specified, that encoding will be used,
            regardless of any BOM or later declaration (such as in a meta
            element).

        :arg scripting: treat noscript elements as if JavaScript was turned on

        :returns: parsed tree

        Example:

        >>> from html5lib.html5parser import HTMLParser
        >>> parser = HTMLParser()
        >>> parser.parse('<html><body><p>This is a doc</p></body></html>')
        <Element u'{http://www.w3.org/1999/xhtml}html' at 0x7feac4909db0>

        N(   RL   RM   R8   R9   t   getDocument(   R>   RJ   t   argsR!   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR     s    c         O` s#   |  j  | t | | Ž |  j j ƒ  S(   uZ  Parse a HTML fragment into a well-formed tree fragment

        :arg container: name of the element we're setting the innerHTML
            property if set to None, default to 'div'

        :arg stream: a file-like object or string containing the HTML to be parsed

            The optional encoding parameter must be a string that indicates
            the encoding.  If specified, that encoding will be used,
            regardless of any BOM or later declaration (such as in a meta
            element)

        :arg scripting: treat noscript elements as if JavaScript was turned on

        :returns: parsed tree

        Example:

        >>> from html5lib.html5libparser import HTMLParser
        >>> parser = HTMLParser()
        >>> parser.parseFragment('<b>this is a fragment</b>')
        <Element u'DOCUMENT_FRAGMENT' at 0x7feac484b090>

        (   RL   R[   R9   t   getFragment(   R>   RJ   R†   R!   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR%   $  s    u   XXX-undefined-errorc         C` s^   | d  k r i  } n  |  j j |  j j j ƒ  | | f ƒ |  j rZ t t | | ƒ ‚ n  d  S(   N(	   R8   R:   Rs   RG   RJ   t   positionR7   t
   ParseErrorR   (   R>   t	   errorcodet   datavars(    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRh   @  s
    	%	c         C` sr   | d t  d k rn | d } t | ƒ | d <t | ƒ t | d ƒ k rn | d j | d  d  d … ƒ qn n  | S(   Nu   typeu   StartTagu   dataiÿÿÿÿ(   R   R   Rj   t   update(   R>   R}   t   raw(    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR„   H  s    
$c         C` s   t  | t ƒ d  S(   N(   t   adjust_attributesR   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR   S  s    c         C` s   t  | t ƒ d  S(   N(   RŽ   R   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR   V  s    c         C` s   t  | t ƒ d  S(   N(   RŽ   t   adjustForeignAttributesMap(   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR   Y  s    c         C` s   |  j  j ƒ  d  S(   N(   RC   RV   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyt   reparseTokenNormal\  s    c         C` s]  t  } i d d 6d d 6d d 6d d 6d d	 6d d
 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6} xß |  j j d  d  d … D]Ä } | j } d  } | |  j j d k rÔ |  j sÂ t ‚ t } |  j } n  | d k rò |  j sò t ‚ n  | r| j |  j j	 k rqˆ n  | | k r5|  j
 | | } Pqˆ | rˆ |  j
 d } Pqˆ qˆ W| |  _ d  S(   Nu   inSelectu   selectu   inCellu   tdu   thu   inRowu   tru   inTableBodyu   tbodyu   theadu   tfootu	   inCaptionu   captionu   inColumnGroupu   colgroupu   inTableu   tableu   inBodyu   headu   bodyu
   inFramesetu   framesetu
   beforeHeadu   htmliÿÿÿÿi    (   u   selectu   colgroupu   headu   html(   RM   R9   Rg   R@   R8   RK   Ru   R[   R`   Rk   R=   RV   (   R>   t   lastt   newModest   nodet   nodeNamet	   new_phase(    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRX   `  sD    
 	c         C` su   | d k s t  ‚ |  j j | ƒ | d k rC |  j j |  j _ n |  j j |  j _ |  j |  _ |  j	 d |  _ d  S(   Nu   RAWTEXTu   RCDATAu   text(   u   RAWTEXTu   RCDATA(
   Ru   R9   t   insertElementRG   RT   RS   RR   RV   t   originalPhaseR=   (   R>   R}   t   contentType(    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyt   parseRCDataRawtextŒ  s    N(   R4   R5   t   __doc__R8   RM   R[   RB   RL   RH   t   propertyR_   Rd   Re   RI   Rf   R   R%   Rh   R„   R   R   R   R�   RX   R™   (    (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR   W   s&   	"
	
		C									,c         ` sT  d „  } d „  } d t  | |  | ƒ ƒ f d „  ƒ  Y‰  d ˆ  f d „  ƒ  Y} d ˆ  f d „  ƒ  Y} d	 ˆ  f ‡  f d
 †  ƒ  Y} d ˆ  f ‡  f d †  ƒ  Y} d ˆ  f ‡  f d †  ƒ  Y} d ˆ  f ‡  f d †  ƒ  Y} d ˆ  f ‡  f d †  ƒ  Y}	 d ˆ  f ‡  f d †  ƒ  Y}
 d ˆ  f ‡  f d †  ƒ  Y} d ˆ  f ‡  f d †  ƒ  Y} d ˆ  f ‡  f d †  ƒ  Y} d ˆ  f ‡  f d †  ƒ  Y} d ˆ  f ‡  f d †  ƒ  Y} d ˆ  f ‡  f d  †  ƒ  Y} d! ˆ  f ‡  f d" †  ƒ  Y} d# ˆ  f ‡  f d$ †  ƒ  Y} d% ˆ  f ‡  f d& †  ƒ  Y} d' ˆ  f ‡  f d( †  ƒ  Y} d) ˆ  f ‡  f d* †  ƒ  Y} d+ ˆ  f ‡  f d, †  ƒ  Y} d- ˆ  f ‡  f d. †  ƒ  Y} d/ ˆ  f ‡  f d0 †  ƒ  Y} d1 ˆ  f ‡  f d2 †  ƒ  Y} i | d3 6| d4 6| d5 6| d6 6| d7 6| d8 6|	 d9 6|
 d: 6| d; 6| d< 6| d= 6| d> 6| d? 6| d@ 6| dA 6| dB 6| dC 6| dD 6| dE 6| dF 6| dG 6| dH 6| dI 6S(J   Nc         ` s2   t  d „  t j ƒ  Dƒ ƒ ‰ ‡  ‡ f d †  } | S(   u4   Logger that records which phase processes each tokenc         s` s!   |  ] \ } } | | f Vq d  S(   N(    (   t   .0t   keyt   value(    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pys	   <genexpr>   s    c         ` sÜ   ˆ  j  j d ƒ rÈ t | ƒ d k rÈ | d } y i ˆ | d d 6} Wn
 ‚  n X| d t k ru | d | d <n  |  j j j |  j j j j  |  j j	 j
 j  |  j
 j  ˆ  j  | f ƒ ˆ  |  | | Ž Sˆ  |  | | Ž Sd  S(   Nu   processi    u   typeu   name(   R4   t
   startswithRj   R   RC   RO   Rs   RG   RS   RV   t	   __class__(   R>   R†   R!   R}   t   info(   R3   t
   type_names(    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyt   wrapped£  s    $
	
(   R;   R   R'   (   R3   R£   (    (   R3   R¢   s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRO   ž  s    	c         S` s   |  r t  | ƒ St Sd  S(   N(   R6   R+   (   t   use_metaclasst   metaclass_func(    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyt   getMetaclass·  s    
t   Phasec           B` s_   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z RS(
   uN   Base class for helper object that implements each phase of processing
        c         S` s   | |  _  | |  _ d  S(   N(   RC   R9   (   R>   RC   R9   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRB   Â  s    	c         S` s
   t  ‚ d  S(   N(   t   NotImplementedError(   R>   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRt   Æ  s    c         S` s!   |  j  j | |  j  j d ƒ d  S(   Niÿÿÿÿ(   R9   t   insertCommentRg   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRq   É  s    c         S` s   |  j  j d ƒ d  S(   Nu   unexpected-doctype(   RC   Rh   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRr   Î  s    c         S` s   |  j  j | d ƒ d  S(   Nu   data(   R9   t
   insertText(   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRm   Ñ  s    c         S` s   |  j  j | d ƒ d  S(   Nu   data(   R9   Rª   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRn   Ô  s    c         S` s   |  j  | d | ƒ S(   Nu   name(   t   startTagHandler(   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRo   ×  s    c         S` s”   |  j  j r0 | d d k r0 |  j  j d ƒ n  xQ | d j ƒ  D]? \ } } | |  j j d j k rA | |  j j d j | <qA qA Wt |  j  _ d  S(   Nu   nameu   htmlu   non-html-rootu   datai    (   RC   RN   Rh   R'   R9   Rg   Ra   RM   (   R>   R}   t   attrRž   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyt   startTagHtmlÚ  s    c         S` s   |  j  | d | ƒ S(   Nu   name(   t   endTagHandler(   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRp   ä  s    (   R4   R5   Rš   RB   Rt   Rq   Rr   Rm   Rn   Ro   R­   Rp   (    (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR§   ¾  s   								
t   InitialPhasec           B` sP   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 RS(   c         S` s   d  S(   N(    (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRn   è  s    c         S` s   |  j  j | |  j  j ƒ d  S(   N(   R9   R©   t   document(   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRq   ë  s    c      8   S` su  | d } | d } | d } | d } | d k sX | d  k	 sX | d  k	 rk | d k rk |  j j d ƒ n  | d  k r€ d } n  |  j j | ƒ | d k r® | j t ƒ } n  | s| d d k s| j dJ ƒ s| dK k s| j dL ƒ rû | d  k s| r"| j ƒ  dD k r"dE |  j _	 n9 | j dM ƒ sL| j dN ƒ r[| d  k	 r[dH |  j _	 n  |  j j
 dI |  j _ d  S(O   Nu   nameu   publicIdu   systemIdu   correctu   htmlu   about:legacy-compatu   unknown-doctypeu    u*   +//silmaril//dtd html pro v0r11 19970101//u4   -//advasoft ltd//dtd html 3.0 aswedit + extensions//u*   -//as//dtd html 3.0 aswedit + extensions//u   -//ietf//dtd html 2.0 level 1//u   -//ietf//dtd html 2.0 level 2//u&   -//ietf//dtd html 2.0 strict level 1//u&   -//ietf//dtd html 2.0 strict level 2//u   -//ietf//dtd html 2.0 strict//u   -//ietf//dtd html 2.0//u   -//ietf//dtd html 2.1e//u   -//ietf//dtd html 3.0//u   -//ietf//dtd html 3.2 final//u   -//ietf//dtd html 3.2//u   -//ietf//dtd html 3//u   -//ietf//dtd html level 0//u   -//ietf//dtd html level 1//u   -//ietf//dtd html level 2//u   -//ietf//dtd html level 3//u"   -//ietf//dtd html strict level 0//u"   -//ietf//dtd html strict level 1//u"   -//ietf//dtd html strict level 2//u"   -//ietf//dtd html strict level 3//u   -//ietf//dtd html strict//u   -//ietf//dtd html//u(   -//metrius//dtd metrius presentational//u5   -//microsoft//dtd internet explorer 2.0 html strict//u.   -//microsoft//dtd internet explorer 2.0 html//u0   -//microsoft//dtd internet explorer 2.0 tables//u5   -//microsoft//dtd internet explorer 3.0 html strict//u.   -//microsoft//dtd internet explorer 3.0 html//u0   -//microsoft//dtd internet explorer 3.0 tables//u#   -//netscape comm. corp.//dtd html//u*   -//netscape comm. corp.//dtd strict html//u*   -//o'reilly and associates//dtd html 2.0//u3   -//o'reilly and associates//dtd html extended 1.0//u;   -//o'reilly and associates//dtd html extended relaxed 1.0//uN   -//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//uE   -//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//u$   -//spyglass//dtd html 2.0 extended//u+   -//sq//dtd html 2.0 hotmetal + extensions//u-   -//sun microsystems corp.//dtd hotjava html//u4   -//sun microsystems corp.//dtd hotjava strict html//u   -//w3c//dtd html 3 1995-03-24//u   -//w3c//dtd html 3.2 draft//u   -//w3c//dtd html 3.2 final//u   -//w3c//dtd html 3.2//u   -//w3c//dtd html 3.2s draft//u   -//w3c//dtd html 4.0 frameset//u#   -//w3c//dtd html 4.0 transitional//u(   -//w3c//dtd html experimental 19960712//u&   -//w3c//dtd html experimental 970421//u   -//w3c//dtd w3 html//u   -//w3o//dtd w3 html 3.0//u#   -//webtechs//dtd mozilla html 2.0//u   -//webtechs//dtd mozilla html//u$   -//w3o//dtd w3 html strict 3.0//en//u"   -/w3c/dtd html 4.0 transitional/enu    -//w3c//dtd html 4.01 frameset//u$   -//w3c//dtd html 4.01 transitional//u:   http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtdu   quirksu    -//w3c//dtd xhtml 1.0 frameset//u$   -//w3c//dtd xhtml 1.0 transitional//u   limited quirksu
   beforeHtml(7   u*   +//silmaril//dtd html pro v0r11 19970101//u4   -//advasoft ltd//dtd html 3.0 aswedit + extensions//u*   -//as//dtd html 3.0 aswedit + extensions//u   -//ietf//dtd html 2.0 level 1//u   -//ietf//dtd html 2.0 level 2//u&   -//ietf//dtd html 2.0 strict level 1//u&   -//ietf//dtd html 2.0 strict level 2//u   -//ietf//dtd html 2.0 strict//u   -//ietf//dtd html 2.0//u   -//ietf//dtd html 2.1e//u   -//ietf//dtd html 3.0//u   -//ietf//dtd html 3.2 final//u   -//ietf//dtd html 3.2//u   -//ietf//dtd html 3//u   -//ietf//dtd html level 0//u   -//ietf//dtd html level 1//u   -//ietf//dtd html level 2//u   -//ietf//dtd html level 3//u"   -//ietf//dtd html strict level 0//u"   -//ietf//dtd html strict level 1//u"   -//ietf//dtd html strict level 2//u"   -//ietf//dtd html strict level 3//u   -//ietf//dtd html strict//u   -//ietf//dtd html//u(   -//metrius//dtd metrius presentational//u5   -//microsoft//dtd internet explorer 2.0 html strict//u.   -//microsoft//dtd internet explorer 2.0 html//u0   -//microsoft//dtd internet explorer 2.0 tables//u5   -//microsoft//dtd internet explorer 3.0 html strict//u.   -//microsoft//dtd internet explorer 3.0 html//u0   -//microsoft//dtd internet explorer 3.0 tables//u#   -//netscape comm. corp.//dtd html//u*   -//netscape comm. corp.//dtd strict html//u*   -//o'reilly and associates//dtd html 2.0//u3   -//o'reilly and associates//dtd html extended 1.0//u;   -//o'reilly and associates//dtd html extended relaxed 1.0//uN   -//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//uE   -//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//u$   -//spyglass//dtd html 2.0 extended//u+   -//sq//dtd html 2.0 hotmetal + extensions//u-   -//sun microsystems corp.//dtd hotjava html//u4   -//sun microsystems corp.//dtd hotjava strict html//u   -//w3c//dtd html 3 1995-03-24//u   -//w3c//dtd html 3.2 draft//u   -//w3c//dtd html 3.2 final//u   -//w3c//dtd html 3.2//u   -//w3c//dtd html 3.2s draft//u   -//w3c//dtd html 4.0 frameset//u#   -//w3c//dtd html 4.0 transitional//u(   -//w3c//dtd html experimental 19960712//u&   -//w3c//dtd html experimental 970421//u   -//w3c//dtd w3 html//u   -//w3o//dtd w3 html 3.0//u#   -//webtechs//dtd mozilla html 2.0//u   -//webtechs//dtd mozilla html//(   u$   -//w3o//dtd w3 html strict 3.0//en//u"   -/w3c/dtd html 4.0 transitional/enu   html(   u    -//w3c//dtd html 4.01 frameset//u$   -//w3c//dtd html 4.01 transitional//(   u    -//w3c//dtd xhtml 1.0 frameset//u$   -//w3c//dtd xhtml 1.0 transitional//(   u    -//w3c//dtd html 4.01 frameset//u$   -//w3c//dtd html 4.01 transitional//(   R8   RC   Rh   R9   t   insertDoctypeRb   R   RŸ   RQ   RP   R=   RV   (   R>   R}   R@   t   publicIdt   systemIdt   correct(    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRr   î  s®    



	                                                      	 	 	 	 	c         S` s&   d |  j  _ |  j  j d |  j  _ d  S(   Nu   quirksu
   beforeHtml(   RC   RP   R=   RV   (   R>   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyt   anythingElseM  s    c         S` s   |  j  j d ƒ |  j ƒ  | S(   Nu   expected-doctype-but-got-chars(   RC   Rh   Rµ   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRm   Q  s    
c         S` s,   |  j  j d i | d d 6ƒ |  j ƒ  | S(   Nu"   expected-doctype-but-got-start-tagu   name(   RC   Rh   Rµ   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRo   V  s    
c         S` s,   |  j  j d i | d d 6ƒ |  j ƒ  | S(   Nu    expected-doctype-but-got-end-tagu   name(   RC   Rh   Rµ   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRp   \  s    
c         S` s   |  j  j d ƒ |  j ƒ  t S(   Nu   expected-doctype-but-got-eof(   RC   Rh   Rµ   R[   (   R>   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRt   b  s    
(
   R4   R5   Rn   Rq   Rr   Rµ   Rm   Ro   Rp   Rt   (    (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR¯   ç  s   			_				t   BeforeHtmlPhasec           B` sG   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   c         S` s3   |  j  j t d d ƒ ƒ |  j j d |  j _ d  S(   Nu   htmlu   StartTagu
   beforeHead(   R9   t
   insertRoott   impliedTagTokenRC   R=   RV   (   R>   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRW   i  s    c         S` s   |  j  ƒ  t S(   N(   RW   R[   (   R>   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRt   n  s    
c         S` s   |  j  j | |  j  j ƒ d  S(   N(   R9   R©   R°   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRq   r  s    c         S` s   d  S(   N(    (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRn   u  s    c         S` s   |  j  ƒ  | S(   N(   RW   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRm   x  s    
c         S` s-   | d d k r t  |  j _ n  |  j ƒ  | S(   Nu   nameu   html(   R[   RC   RN   RW   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRo   |  s    
c         S` sC   | d d k r1 |  j  j d i | d d 6ƒ n |  j ƒ  | Sd  S(   Nu   nameu   headu   bodyu   htmlu   bru   unexpected-end-tag-before-html(   u   headu   bodyu   htmlu   br(   RC   Rh   RW   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRp   ‚  s
    
(	   R4   R5   RW   Rt   Rq   Rn   Rm   Ro   Rp   (    (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR¶   g  s   						t   BeforeHeadPhasec           ` s_   e  Z ‡  f d  †  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 RS(	   c         ` s}   ˆ  j  |  | | ƒ t j d |  j f d |  j f g ƒ |  _ |  j |  j _ t j d |  j f g ƒ |  _	 |  j
 |  j	 _ d  S(   Nu   htmlu   headu   bodyu   br(   u   headu   bodyu   htmlu   br(   RB   R
   t   MethodDispatcherR­   t   startTagHeadR«   t   startTagOthert   defaultt   endTagImplyHeadR®   t   endTagOther(   R>   RC   R9   (   R§   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRB   ‹  s    c         S` s   |  j  t d d ƒ ƒ t S(   Nu   headu   StartTag(   R»   R¸   R[   (   R>   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRt   ™  s    c         S` s   d  S(   N(    (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRn   �  s    c         S` s   |  j  t d d ƒ ƒ | S(   Nu   headu   StartTag(   R»   R¸   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRm      s    c         S` s   |  j  j d j | ƒ S(   Nu   inBody(   RC   R=   Ro   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR­   ¤  s    c         S` s@   |  j  j | ƒ |  j  j d |  j  _ |  j j d |  j _ d  S(   Niÿÿÿÿu   inHead(   R9   R–   Rg   t   headPointerRC   R=   RV   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR»   §  s    c         S` s   |  j  t d d ƒ ƒ | S(   Nu   headu   StartTag(   R»   R¸   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR¼   ¬  s    c         S` s   |  j  t d d ƒ ƒ | S(   Nu   headu   StartTag(   R»   R¸   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR¾   °  s    c         S` s"   |  j  j d i | d d 6ƒ d  S(   Nu   end-tag-after-implied-rootu   name(   RC   Rh   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR¿   ´  s    (   R4   R5   RB   Rt   Rn   Rm   R­   R»   R¼   R¾   R¿   (    (   R§   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR¹   Š  s   							t   InHeadPhasec           ` sž   e  Z ‡  f d  †  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z d
 „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   c         ` sÑ   ˆ  j  |  | | ƒ t j d |  j f d |  j f d |  j f d |  j f d |  j f d |  j f d |  j	 f d |  j
 f g ƒ |  _ |  j |  j _ t j d |  j f d |  j f g ƒ |  _ |  j |  j _ d  S(   Nu   htmlu   titleu   noframesu   styleu   noscriptu   scriptu   baseu   basefontu   bgsoundu   commandu   linku   metau   headu   bru   body(   u   noframesu   style(   u   baseu   basefontu   bgsoundu   commandu   link(   u   bru   htmlu   body(   RB   R
   Rº   R­   t   startTagTitlet   startTagNoFramesStylet   startTagNoscriptt   startTagScriptt   startTagBaseLinkCommandt   startTagMetaR»   R«   R¼   R½   t
   endTagHeadt   endTagHtmlBodyBrR®   R¿   (   R>   RC   R9   (   R§   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRB   ¹  s     	c         S` s   |  j  ƒ  t S(   N(   Rµ   R[   (   R>   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRt   Ð  s    
c         S` s   |  j  ƒ  | S(   N(   Rµ   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRm   Ô  s    
c         S` s   |  j  j d j | ƒ S(   Nu   inBody(   RC   R=   Ro   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR­   Ø  s    c         S` s   |  j  j d ƒ d  S(   Nu!   two-heads-are-not-better-than-one(   RC   Rh   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR»   Û  s    c         S` s.   |  j  j | ƒ |  j  j j ƒ  t | d <d  S(   Nu   selfClosingAcknowledged(   R9   R–   Rg   t   popR[   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRÆ   Þ  s    c         S` sþ   |  j  j | ƒ |  j  j j ƒ  t | d <| d } |  j j j j d d k rú d | k ry |  j j j j	 | d ƒ qú d | k rú d | k rú | d j
 ƒ  d k rú t j | d j d	 ƒ ƒ } t j | ƒ } | j ƒ  } |  j j j j	 | ƒ qú n  d  S(
   Nu   selfClosingAcknowledgedu   datai   u	   tentativeu   charsetu   contentu
   http-equivu   content-typeu   utf-8(   R9   R–   Rg   RÊ   R[   RC   RG   RJ   R^   t   changeEncodingRQ   R   t   EncodingBytest   encodet   ContentAttrParserR   (   R>   R}   Ra   t   dataRC   t   codec(    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRÇ   ã  s    

c         S` s   |  j  j | d ƒ d  S(   Nu   RCDATA(   RC   R™   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRÂ   ø  s    c         S` s   |  j  j | d ƒ d  S(   Nu   RAWTEXT(   RC   R™   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRÃ   û  s    c         S` sL   |  j  j r" |  j  j | d ƒ n& |  j j | ƒ |  j  j d |  j  _ d  S(   Nu   RAWTEXTu   inHeadNoscript(   RC   RE   R™   R9   R–   R=   RV   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRÄ   ÿ  s    c         S` sT   |  j  j | ƒ |  j j j |  j j _ |  j j |  j _ |  j j d |  j _ d  S(   Nu   text(	   R9   R–   RC   RG   t   scriptDataStateRS   RV   R—   R=   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRÅ     s    c         S` s   |  j  ƒ  | S(   N(   Rµ   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR¼     s    
c         S` sQ   |  j  j j j ƒ  } | j d k s7 t d | j ƒ ‚ |  j  j d |  j  _ d  S(   Nu   headu   Expected head got %su	   afterHead(   RC   R9   Rg   RÊ   R@   Ru   R=   RV   (   R>   R}   R“   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRÈ     s    "c         S` s   |  j  ƒ  | S(   N(   Rµ   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRÉ     s    
c         S` s"   |  j  j d i | d d 6ƒ d  S(   Nu   unexpected-end-tagu   name(   RC   Rh   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR¿     s    c         S` s   |  j  t d ƒ ƒ d  S(   Nu   head(   RÈ   R¸   (   R>   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRµ     s    (   R4   R5   RB   Rt   Rm   R­   R»   RÆ   RÇ   RÂ   RÃ   RÄ   RÅ   R¼   RÈ   RÉ   R¿   Rµ   (    (   R§   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRÁ   ¸  s    														t   InHeadNoscriptPhasec           ` sƒ   e  Z ‡  f d  †  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z d
 „  Z d „  Z d „  Z RS(   c         ` s•   ˆ  j  |  | | ƒ t j d |  j f d |  j f d |  j f g ƒ |  _ |  j |  j _ t j d	 |  j	 f d
 |  j
 f g ƒ |  _ |  j |  j _ d  S(   Nu   htmlu   basefontu   bgsoundu   linku   metau   noframesu   styleu   headu   noscriptu   br(   u   basefontu   bgsoundu   linku   metau   noframesu   style(   u   headu   noscript(   RB   R
   Rº   R­   RÆ   t   startTagHeadNoscriptR«   R¼   R½   t   endTagNoscriptt   endTagBrR®   R¿   (   R>   RC   R9   (   R§   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRB      s    c         S` s   |  j  j d ƒ |  j ƒ  t S(   Nu   eof-in-head-noscript(   RC   Rh   Rµ   R[   (   R>   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRt   0  s    
c         S` s   |  j  j d j | ƒ S(   Nu   inHead(   RC   R=   Rq   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRq   5  s    c         S` s   |  j  j d ƒ |  j ƒ  | S(   Nu   char-in-head-noscript(   RC   Rh   Rµ   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRm   8  s    
c         S` s   |  j  j d j | ƒ S(   Nu   inHead(   RC   R=   Rn   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRn   =  s    c         S` s   |  j  j d j | ƒ S(   Nu   inBody(   RC   R=   Ro   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR­   @  s    c         S` s   |  j  j d j | ƒ S(   Nu   inHead(   RC   R=   Ro   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRÆ   C  s    c         S` s"   |  j  j d i | d d 6ƒ d  S(   Nu   unexpected-start-tagu   name(   RC   Rh   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRÓ   F  s    c         S` s,   |  j  j d i | d d 6ƒ |  j ƒ  | S(   Nu   unexpected-inhead-noscript-tagu   name(   RC   Rh   Rµ   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR¼   I  s    
c         S` sQ   |  j  j j j ƒ  } | j d k s7 t d | j ƒ ‚ |  j  j d |  j  _ d  S(   Nu   noscriptu   Expected noscript got %su   inHead(   RC   R9   Rg   RÊ   R@   Ru   R=   RV   (   R>   R}   R“   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRÔ   N  s    "c         S` s,   |  j  j d i | d d 6ƒ |  j ƒ  | S(   Nu   unexpected-inhead-noscript-tagu   name(   RC   Rh   Rµ   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRÕ   S  s    
c         S` s"   |  j  j d i | d d 6ƒ d  S(   Nu   unexpected-end-tagu   name(   RC   Rh   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR¿   X  s    c         S` s   |  j  t d ƒ ƒ d  S(   Nu   noscript(   RÔ   R¸   (   R>   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRµ   [  s    (   R4   R5   RB   Rt   Rq   Rm   Rn   R­   RÆ   RÓ   R¼   RÔ   RÕ   R¿   Rµ   (    (   R§   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRÒ     s   											t   AfterHeadPhasec           ` sz   e  Z ‡  f d  †  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z d
 „  Z d „  Z RS(   c         ` s¡   ˆ  j  |  | | ƒ t j d |  j f d |  j f d |  j f d |  j f d |  j f g ƒ |  _ |  j	 |  j _
 t j d |  j f g ƒ |  _ |  j |  j _
 d  S(   Nu   htmlu   bodyu   framesetu   baseu   basefontu   bgsoundu   linku   metau   noframesu   scriptu   styleu   titleu   headu   br(	   u   baseu   basefontu   bgsoundu   linku   metau   noframesu   scriptu   styleu   title(   u   bodyu   htmlu   br(   RB   R
   Rº   R­   t   startTagBodyt   startTagFramesett   startTagFromHeadR»   R«   R¼   R½   RÉ   R®   R¿   (   R>   RC   R9   (   R§   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRB   `  s     		c         S` s   |  j  ƒ  t S(   N(   Rµ   R[   (   R>   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRt   q  s    
c         S` s   |  j  ƒ  | S(   N(   Rµ   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRm   u  s    
c         S` s   |  j  j d j | ƒ S(   Nu   inBody(   RC   R=   Ro   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR­   y  s    c         S` s6   t  |  j _ |  j j | ƒ |  j j d |  j _ d  S(   Nu   inBody(   RM   RC   R\   R9   R–   R=   RV   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR×   |  s    c         S` s*   |  j  j | ƒ |  j j d |  j _ d  S(   Nu
   inFrameset(   R9   R–   RC   R=   RV   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRØ   �  s    c         S` sœ   |  j  j d i | d d 6ƒ |  j j j |  j j ƒ |  j  j d j | ƒ xG |  j j d  d  d … D], } | j d k rh |  j j j	 | ƒ Pqh qh Wd  S(   Nu#   unexpected-start-tag-out-of-my-headu   nameu   inHeadiÿÿÿÿu   head(
   RC   Rh   R9   Rg   Rs   RÀ   R=   Ro   R@   t   remove(   R>   R}   R“   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRÙ   …  s     c         S` s"   |  j  j d i | d d 6ƒ d  S(   Nu   unexpected-start-tagu   name(   RC   Rh   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR»   �  s    c         S` s   |  j  ƒ  | S(   N(   Rµ   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR¼   ’  s    
c         S` s   |  j  ƒ  | S(   N(   Rµ   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRÉ   –  s    
c         S` s"   |  j  j d i | d d 6ƒ d  S(   Nu   unexpected-end-tagu   name(   RC   Rh   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR¿   š  s    c         S` s?   |  j  j t d d ƒ ƒ |  j j d |  j _ t |  j _ d  S(   Nu   bodyu   StartTagu   inBody(   R9   R–   R¸   RC   R=   RV   R[   R\   (   R>   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRµ   �  s    (   R4   R5   RB   Rt   Rm   R­   R×   RØ   RÙ   R»   R¼   RÉ   R¿   Rµ   (    (   R§   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRÖ   _  s   						
				t   InBodyPhasec           ` sÙ  e  Z ‡  f d  †  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z d
 „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z  d „  Z! d  „  Z" d! „  Z# d" „  Z$ d# „  Z% d$ „  Z& d% „  Z' d& „  Z( d' „  Z) d( „  Z* d) „  Z+ d* „  Z, d+ „  Z- d, „  Z. d- „  Z/ d. „  Z0 d/ „  Z1 d0 „  Z2 d1 „  Z3 d2 „  Z4 RS(3   c      ,   ` si  ˆ  j  |  | | ƒ |  j |  _ t j d |  j f dd |  j f d |  j f d |  j f de |  j	 f t
 |  j f df |  j f d& |  j f dg |  j f d* |  j f d+ |  j f dh |  j f d8 |  j f d9 |  j f di |  j f d= |  j f d> |  j f dj |  j f dk |  j f dH |  j f dI |  j f dJ |  j f dK |  j f dL |  j f dM |  j f dN |  j f dl |  j  f dQ |  j! f dm |  j" f dn |  j# f dV |  j$ f dW |  j% f do |  j& f g! ƒ |  _' |  j( |  j' _) t j d |  j* f d |  j+ f dp |  j, f d& |  j- f d  |  j. f dq |  j/ f t
 |  j0 f dr |  j1 f ds |  j2 f d@ |  j3 f g
 ƒ |  _4 |  j5 |  j4 _) d  S(t   Nu   htmlu   baseu   basefontu   bgsoundu   commandu   linku   metau   scriptu   styleu   titleu   bodyu   framesetu   addressu   articleu   asideu
   blockquoteu   centeru   detailsu   diru   divu   dlu   fieldsetu
   figcaptionu   figureu   footeru   headeru   hgroupu   mainu   menuu   navu   olu   pu   sectionu   summaryu   ulu   preu   listingu   formu   liu   ddu   dtu	   plaintextu   au   bu   bigu   codeu   emu   fontu   iu   su   smallu   strikeu   strongu   ttu   uu   nobru   buttonu   appletu   marqueeu   objectu   xmpu   tableu   areau   bru   embedu   imgu   keygenu   wbru   paramu   sourceu   tracku   inputu   hru   imageu   isindexu   textareau   iframeu   noscriptu   noembedu   noframesu   selectu   rpu   rtu   optionu   optgroupu   mathu   svgu   captionu   colu   colgroupu   frameu   headu   tbodyu   tdu   tfootu   thu   theadu   tru   dialog(	   u   baseu   basefontu   bgsoundu   commandu   linku   metau   scriptu   styleu   title(   u   addressu   articleu   asideu
   blockquoteu   centeru   detailsu   diru   divu   dlu   fieldsetu
   figcaptionu   figureu   footeru   headeru   hgroupu   mainu   menuu   navu   olu   pu   sectionu   summaryu   ul(   u   preu   listing(   u   liu   ddu   dt(   u   bu   bigu   codeu   emu   fontu   iu   su   smallu   strikeu   strongu   ttu   u(   u   appletu   marqueeu   object(   u   areau   bru   embedu   imgu   keygenu   wbr(   u   paramu   sourceu   track(   u   noembedu   noframes(   u   rpu   rt(   u   optionu   optgroup(   u   captionu   colu   colgroupu   frameu   headu   tbodyu   tdu   tfootu   thu   theadu   tr(   u   addressu   articleu   asideu
   blockquoteu   buttonu   centeru   detailsu   dialogu   diru   divu   dlu   fieldsetu
   figcaptionu   figureu   footeru   headeru   hgroupu   listingu   mainu   menuu   navu   olu   preu   sectionu   summaryu   ul(   u   ddu   dtu   li(   u   au   bu   bigu   codeu   emu   fontu   iu   nobru   su   smallu   strikeu   strongu   ttu   u(   u   appletu   marqueeu   object(6   RB   t   processSpaceCharactersNonPreRn   R
   Rº   R­   t   startTagProcessInHeadR×   RØ   t   startTagClosePR   t   startTagHeadingt   startTagPreListingt   startTagFormt   startTagListItemt   startTagPlaintextt	   startTagAt   startTagFormattingt   startTagNobrt   startTagButtont   startTagAppletMarqueeObjectt   startTagXmpt   startTagTablet   startTagVoidFormattingt   startTagParamSourcet   startTagInputt
   startTagHrt   startTagImaget   startTagIsIndext   startTagTextareat   startTagIFrameRÄ   t   startTagRawtextt   startTagSelectt   startTagRpRtt   startTagOptt   startTagMatht   startTagSvgt   startTagMisplacedR«   R¼   R½   t
   endTagBodyt
   endTagHtmlt   endTagBlockt
   endTagFormt   endTagPt   endTagListItemt   endTagHeadingt   endTagFormattingt   endTagAppletMarqueeObjectRÕ   R®   R¿   (   R>   RC   R9   (   R§   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRB   ¥  s~     	   	 	      c         S` s4   | j  | j  k o3 | j | j k o3 | j | j k S(   N(   R@   R`   Ra   (   R>   t   node1t   node2(    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyt   isMatchingFormattingElementì  s    c         S` s×   |  j  j | ƒ |  j  j d } g  } xS |  j  j d  d  d … D]8 } | t k rV Pq@ |  j | | ƒ r@ | j | ƒ q@ q@ Wt | ƒ d k s” t ‚ t | ƒ d k rÀ |  j  j j	 | d ƒ n  |  j  j j | ƒ d  S(   Niÿÿÿÿi   (
   R9   R–   Rg   t   activeFormattingElementsR	   R  Rs   Rj   Ru   RÚ   (   R>   R}   Rc   t   matchingElementsR“   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyt   addFormattingElementò  s     c         S` sW   t  d ƒ } xD |  j j d  d  d … D]) } | j | k r& |  j j d ƒ Pq& q& Wd  S(   Nu   ddu   dtu   liu   pu   tbodyu   tdu   tfootu   thu   theadu   tru   bodyu   htmliÿÿÿÿu    expected-closing-tag-but-got-eof(   u   ddu   dtu   liu   pu   tbodyu   tdu   tfootu   thu   theadu   tru   bodyu   html(   Rl   R9   Rg   R@   RC   Rh   (   R>   t   allowed_elementsR“   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRt     s     	 c         S` sŒ   | d } |  j  |  _ | j d ƒ rb |  j j d j d k rb |  j j d j ƒ  rb | d } n  | rˆ |  j j ƒ  |  j j | ƒ n  d  S(	   Nu   datau   
iÿÿÿÿu   preu   listingu   textareai   (   u   preu   listingu   textarea(	   RÜ   Rn   RŸ   R9   Rg   R@   t
   hasContentt#   reconstructActiveFormattingElementsRª   (   R>   R}   RÏ   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyt!   processSpaceCharactersDropNewline  s    
c         S` s}   | d d k r d  S|  j  j ƒ  |  j  j | d ƒ |  j j ry t g  | d D] } | t k ^ qO ƒ ry t |  j _ n  d  S(   Nu   datau    (   R9   R  Rª   RC   R\   t   anyR   RM   (   R>   R}   t   char(    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRm     s    #c         S` s%   |  j  j ƒ  |  j  j | d ƒ d  S(   Nu   data(   R9   R  Rª   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRÜ   &  s    c         S` s   |  j  j d j | ƒ S(   Nu   inHead(   RC   R=   Ro   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRÝ   *  s    c         S` sÄ   |  j  j d i d d 6ƒ t |  j j ƒ d k sK |  j j d j d k r` |  j  j sÀ t ‚ n` t |  j  _	 xQ | d j
 ƒ  D]? \ } } | |  j j d j k r} | |  j j d j | <q} q} Wd  S(   Nu   unexpected-start-tagu   bodyu   namei   u   data(   RC   Rh   Rj   R9   Rg   R@   RK   Ru   RM   R\   R'   Ra   (   R>   R}   R¬   Rž   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR×   -  s    c         S` s  |  j  j d i d d 6ƒ t |  j j ƒ d k sK |  j j d j d k r` |  j  j sÿ t ‚ nŸ |  j  j so n� |  j j d j	 r© |  j j d j	 j
 |  j j d ƒ n  x- |  j j d j d k rØ |  j j j ƒ  q¬ W|  j j | ƒ |  j  j d |  j  _ d  S(	   Nu   unexpected-start-tagu   framesetu   namei   u   bodyiÿÿÿÿu   htmlu
   inFrameset(   RC   Rh   Rj   R9   Rg   R@   RK   Ru   R\   t   parentt   removeChildRÊ   R–   R=   RV   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRØ   8  s    1'c         S` sB   |  j  j d d d ƒr. |  j t d ƒ ƒ n  |  j  j | ƒ d  S(   Nu   pt   variantu   button(   R9   t   elementInScopeRþ   R¸   R–   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRÞ   F  s    c         S` sZ   |  j  j d d d ƒr. |  j t d ƒ ƒ n  |  j  j | ƒ t |  j _ |  j |  _	 d  S(   Nu   pR  u   button(
   R9   R  Rþ   R¸   R–   RM   RC   R\   R  Rn   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRà   K  s
    c         S` s�   |  j  j r) |  j j d i d d 6ƒ nT |  j  j d d d ƒrW |  j t d ƒ ƒ n  |  j  j | ƒ |  j  j d |  j  _ d  S(   Nu   unexpected-start-tagu   formu   nameu   pR  u   buttoniÿÿÿÿ(	   R9   t   formPointerRC   Rh   R  Rþ   R¸   R–   Rg   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRá   R  s    c         S` s   t  |  j _ i d g d 6d d g d 6d d g d 6} | | d } xn t |  j j ƒ D]Z } | j | k r� |  j j j t	 | j d ƒ ƒ Pn  | j
 t k rW | j d k rW PqW qW W|  j j d d	 d
 ƒrì |  j j j t	 d d ƒ ƒ n  |  j j | ƒ d  S(   Nu   liu   dtu   ddu   nameu   EndTagu   addressu   divu   pR  u   button(   u   addressu   divu   p(   RM   RC   R\   t   reversedR9   Rg   R@   RV   Rp   R¸   t	   nameTupleR   R  R–   (   R>   R}   t   stopNamesMapt	   stopNamesR“   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRâ   [  s"    c         S` sZ   |  j  j d d d ƒr. |  j t d ƒ ƒ n  |  j  j | ƒ |  j j j |  j j _ d  S(   Nu   pR  u   button(	   R9   R  Rþ   R¸   R–   RC   RG   RU   RS   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRã   q  s    c         S` sŒ   |  j  j d d d ƒr. |  j t d ƒ ƒ n  |  j  j d j t k rx |  j j d i | d d 6ƒ |  j  j j	 ƒ  n  |  j  j
 | ƒ d  S(   Nu   pR  u   buttoniÿÿÿÿu   unexpected-start-tagu   name(   R9   R  Rþ   R¸   Rg   R@   R   RC   Rh   RÊ   R–   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRß   w  s    c         S` s½   |  j  j d ƒ } | rŸ |  j j d i d d 6d d 6ƒ |  j t d ƒ ƒ | |  j  j k rt |  j  j j | ƒ n  | |  j  j k rŸ |  j  j j | ƒ qŸ n  |  j  j	 ƒ  |  j
 | ƒ d  S(   Nu   au$   unexpected-start-tag-implies-end-tagu	   startNameu   endName(   R9   t!   elementInActiveFormattingElementsRC   Rh   R  R¸   Rg   RÚ   R  R  R  (   R>   R}   t   afeAElement(    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRä     s    c         S` s   |  j  j ƒ  |  j | ƒ d  S(   N(   R9   R  R  (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRå   Œ  s    c         S` st   |  j  j ƒ  |  j  j d ƒ rc |  j j d i d d 6d d 6ƒ |  j t d ƒ ƒ |  j  j ƒ  n  |  j | ƒ d  S(   Nu   nobru$   unexpected-start-tag-implies-end-tagu	   startNameu   endName(   R9   R  R  RC   Rh   Rp   R¸   R  (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRæ   �  s    c         S` sw   |  j  j d ƒ rJ |  j j d i d d 6d d 6ƒ |  j t d ƒ ƒ | S|  j  j ƒ  |  j  j | ƒ t |  j _	 d  S(   Nu   buttonu$   unexpected-start-tag-implies-end-tagu	   startNameu   endName(
   R9   R  RC   Rh   Rp   R¸   R  R–   RM   R\   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRç   š  s    c         S` s@   |  j  j ƒ  |  j  j | ƒ |  j  j j t ƒ t |  j _ d  S(   N(	   R9   R  R–   R  Rs   R	   RM   RC   R\   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRè   ¥  s    c         S` s^   |  j  j d d d ƒr. |  j t d ƒ ƒ n  |  j  j ƒ  t |  j _ |  j j | d ƒ d  S(   Nu   pR  u   buttonu   RAWTEXT(	   R9   R  Rþ   R¸   R  RM   RC   R\   R™   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRé   «  s
    c         S` sy   |  j  j d k rC |  j j d d d ƒrC |  j t d ƒ ƒ qC n  |  j j | ƒ t |  j  _ |  j  j	 d |  j  _
 d  S(   Nu   quirksu   pR  u   buttonu   inTable(   RC   RP   R9   R  Rp   R¸   R–   RM   R\   R=   RV   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRê   ²  s    c         S` sG   |  j  j ƒ  |  j  j | ƒ |  j  j j ƒ  t | d <t |  j _ d  S(   Nu   selfClosingAcknowledged(	   R9   R  R–   Rg   RÊ   R[   RM   RC   R\   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRë   º  s
    
c         S` sY   |  j  j } |  j | ƒ d | d k rU | d d j t ƒ d k rU | |  j  _ n  d  S(   Nu   typeu   datau   hidden(   RC   R\   Rë   Rb   R   (   R>   R}   R\   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRí   Á  s
    c         S` s.   |  j  j | ƒ |  j  j j ƒ  t | d <d  S(   Nu   selfClosingAcknowledged(   R9   R–   Rg   RÊ   R[   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRì   É  s    c         S` sh   |  j  j d d d ƒr. |  j t d ƒ ƒ n  |  j  j | ƒ |  j  j j ƒ  t | d <t |  j	 _
 d  S(   Nu   pR  u   buttonu   selfClosingAcknowledged(   R9   R  Rþ   R¸   R–   Rg   RÊ   R[   RM   RC   R\   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRî   Î  s    
c      	   S` sO   |  j  j d i d d 6d d 6ƒ |  j t d d d | d d	 | d
 ƒƒ d  S(   Nu   unexpected-start-tag-treated-asu   imageu   originalNameu   imgu   newNameu   StartTagRa   u   datat   selfClosingu   selfClosing(   RC   Rh   Ro   R¸   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRï   Ö  s
    
c      	   S` s�  |  j  j d i d d 6ƒ |  j j r* d  Si  } d | d k rU | d d | d <n  |  j t d d d | ƒƒ |  j t d	 d ƒ ƒ |  j t d
 d ƒ ƒ d | d k r¾ | d d } n d } |  j i t d d 6| d 6ƒ | d j ƒ  } d | k r	| d =n  d | k r| d =n  d | d <|  j t d d d | d | d ƒƒ |  j	 t d
 ƒ ƒ |  j t d	 d ƒ ƒ |  j	 t d ƒ ƒ d  S(   Nu   deprecated-tagu   isindexu   nameu   actionu   datau   formu   StartTagRa   u   hru   labelu   promptu3   This is a searchable index. Enter search keywords: u
   Charactersu   typeu   inputR  u   selfClosing(
   RC   Rh   R9   R  Ro   R¸   Rm   R   t   copyRp   (   R>   R}   t
   form_attrst   promptRa   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRð   Þ  s6    



c         S` sD   |  j  j | ƒ |  j j j |  j j _ |  j |  _ t |  j _	 d  S(   N(
   R9   R–   RC   RG   RR   RS   R  Rn   RM   R\   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRñ   ý  s    c         S` s   t  |  j _ |  j | ƒ d  S(   N(   RM   RC   R\   Ró   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRò     s    c         S` s-   |  j  j r |  j | ƒ n |  j | ƒ d  S(   N(   RC   RE   Ró   R¼   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRÄ     s    c         S` s   |  j  j | d ƒ d S(   u8   iframe, noembed noframes, noscript(if scripting enabled)u   RAWTEXTN(   RC   R™   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRó     s    c         S` sY   |  j  j d j d k r5 |  j j j t d ƒ ƒ n  |  j  j ƒ  |  j j  j | ƒ d  S(   Niÿÿÿÿu   option(	   R9   Rg   R@   RC   RV   Rp   R¸   R  R–   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRö     s    c         S` s¼   |  j  j ƒ  |  j  j | ƒ t |  j _ |  j j |  j j d |  j j d |  j j d |  j j d |  j j d |  j j d f k r¢ |  j j d |  j _ n |  j j d |  j _ d  S(	   Nu   inTableu	   inCaptionu   inColumnGroupu   inTableBodyu   inRowu   inCellu   inSelectInTableu   inSelect(   R9   R  R–   RM   RC   R\   RV   R=   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRô     s    c         S` s_   |  j  j d ƒ rK |  j  j ƒ  |  j  j d j d k rK |  j j ƒ  qK n  |  j  j | ƒ d  S(   Nu   rubyiÿÿÿÿ(   R9   R  t   generateImpliedEndTagsRg   R@   RC   Rh   R–   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRõ   %  s
    c         S` sv   |  j  j ƒ  |  j j | ƒ |  j j | ƒ t d | d <|  j  j | ƒ | d rr |  j  j j ƒ  t	 | d <n  d  S(   Nu   mathmlu	   namespaceu   selfClosingu   selfClosingAcknowledged(
   R9   R  RC   R   R   R   R–   Rg   RÊ   R[   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR÷   ,  s    
c         S` sv   |  j  j ƒ  |  j j | ƒ |  j j | ƒ t d | d <|  j  j | ƒ | d rr |  j  j j ƒ  t	 | d <n  d  S(   Nu   svgu	   namespaceu   selfClosingu   selfClosingAcknowledged(
   R9   R  RC   R   R   R   R–   Rg   RÊ   R[   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRø   8  s    
c         S` s"   |  j  j d i | d d 6ƒ d S(   u5   Elements that should be children of other elements that have a
            different insertion mode; here they are ignored
            "caption", "col", "colgroup", "frame", "frameset", "head",
            "option", "optgroup", "tbody", "td", "tfoot", "th", "thead",
            "tr", "noscript"
            u   unexpected-start-tag-ignoredu   nameN(   RC   Rh   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRù   D  s    c         S` s!   |  j  j ƒ  |  j  j | ƒ d  S(   N(   R9   R  R–   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR¼   M  s    c         S` så   |  j  j d d d ƒsa |  j t d d ƒ ƒ |  j j d i d d 6ƒ |  j t d d ƒ ƒ n€ |  j  j d ƒ |  j  j d j	 d k r§ |  j j d i d d 6ƒ n  |  j  j j
 ƒ  } x% | j	 d k rà |  j  j j
 ƒ  } q¼ Wd  S(	   Nu   pR  u   buttonu   StartTagu   unexpected-end-tagu   nameu   EndTagiÿÿÿÿ(   R9   R  RÞ   R¸   RC   Rh   Rþ   R  Rg   R@   RÊ   (   R>   R}   R“   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRþ   Q  s    c         S` s±   |  j  j d ƒ s# |  j j ƒ  d  S|  j  j d j d k r— xX |  j  j d D]C } | j t d ƒ k rM |  j j d i d d 6| j d 6ƒ PqM qM Wn  |  j j d |  j _ d  S(   Nu   bodyiÿÿÿÿi   u   ddu   dtu   liu   optgroupu   optionu   pu   rpu   rtu   tbodyu   tdu   tfootu   thu   theadu   tru   htmlu$   expected-one-end-tag-but-got-anotheru   gotNameu   expectedNameu	   afterBody(   u   ddu   dtu   liu   optgroupu   optionu   pu   rpu   rtu   tbodyu   tdu   tfootu   thu   theadu   tru   bodyu   html(	   R9   R  RC   Rh   Rg   R@   Rl   R=   RV   (   R>   R}   R“   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRú   ^  s    	   	c         S` s-   |  j  j d ƒ r) |  j t d ƒ ƒ | Sd  S(   Nu   body(   R9   R  Rú   R¸   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRû   p  s    c         S` sÔ   | d d k r |  j  |  _ n  |  j j | d ƒ } | rK |  j j ƒ  n  |  j j d j | d k r‰ |  j j d i | d d 6ƒ n  | rÐ |  j j j	 ƒ  } x, | j | d k rÌ |  j j j	 ƒ  } q¤ Wn  d  S(   Nu   nameu   preiÿÿÿÿu   end-tag-too-early(
   RÜ   Rn   R9   R  R  Rg   R@   RC   Rh   RÊ   (   R>   R}   t   inScopeR“   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRü   v  s    !c         S` s«   |  j  j } d  |  j  _ | d  k s7 |  j  j | ƒ rT |  j j d i d d 6ƒ nS |  j  j ƒ  |  j  j d | k r” |  j j d i d d 6ƒ n  |  j  j j | ƒ d  S(   Nu   unexpected-end-tagu   formu   nameiÿÿÿÿu   end-tag-too-early-ignored(	   R9   R  R8   R  RC   Rh   R  Rg   RÚ   (   R>   R}   R“   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRý   „  s    c         S` só   | d d k r d } n d  } |  j j | d d | ƒs\ |  j j d i | d d 6ƒ n“ |  j j d | d ƒ |  j j d j | d k r± |  j j d i | d d 6ƒ n  |  j j j ƒ  } x) | j | d k rî |  j j j ƒ  } qÆ Wd  S(	   Nu   nameu   liu   listR  u   unexpected-end-tagt   excludeiÿÿÿÿu   end-tag-too-early(	   R8   R9   R  RC   Rh   R  Rg   R@   RÊ   (   R>   R}   R  R“   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRÿ   ‘  s    	!	c         S` s×   x1 t  D]) } |  j j | ƒ r |  j j ƒ  Pq q W|  j j d j | d k rr |  j j d i | d d 6ƒ n  x^ t  D]V } |  j j | ƒ ry |  j j j ƒ  } x% | j t  k rÊ |  j j j ƒ  } q¦ WPqy qy Wd  S(   Niÿÿÿÿu   nameu   end-tag-too-early(	   R   R9   R  R  Rg   R@   RC   Rh   RÊ   (   R>   R}   t   item(    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR   ¢  s    !c         S` s3  d } x&| d k  r.| d 7} |  j  j | d ƒ } | sd | |  j  j k ru |  j  j | j ƒ ru |  j | ƒ d S| |  j  j k r¼ |  j j d i | d d 6ƒ |  j  j j	 | ƒ d S|  j  j | j ƒ só |  j j d i | d d 6ƒ d S| |  j  j d k r*|  j j d	 i | d d 6ƒ n  |  j  j j
 | ƒ } d } x1 |  j  j | D] } | j t k rV| } PqVqVW| d k rÓ|  j  j j ƒ  } x" | | k r»|  j  j j ƒ  } qšW|  j  j j	 | ƒ d S|  j  j | d } |  j  j j
 | ƒ } | }	 }
 d } |  j  j j
 |
 ƒ } x| d
 k  r9| d 7} | d 8} |  j  j | }
 |
 |  j  j k r|  j  j j	 |
 ƒ q$n  |
 | k r�Pn  |	 | k r·|  j  j j
 |
 ƒ d } n  |
 j ƒ  } | |  j  j |  j  j j
 |
 ƒ <| |  j  j |  j  j j
 |
 ƒ <| }
 |	 j r#|	 j j |	 ƒ n  |
 j |	 ƒ |
 }	 q$W|	 j rV|	 j j |	 ƒ n  | j t d ƒ k r“|  j  j ƒ  \ } } | j |	 | ƒ n | j |	 ƒ | j ƒ  } | j | ƒ | j | ƒ |  j  j j	 | ƒ |  j  j j | | ƒ |  j  j j	 | ƒ |  j  j j |  j  j j
 | ƒ d | ƒ q	 Wd S(   u)   The much-feared adoption agency algorithmi    i   i   u   nameNu   adoption-agency-1.2u   adoption-agency-4.4iÿÿÿÿu   adoption-agency-1.3i   u   tableu   tbodyu   tfootu   theadu   tr(   u   tableu   tbodyu   tfootu   theadu   tr(   R9   R  Rg   R  R@   R¿   RC   Rh   R  RÚ   t   indexR8   R  R   RÊ   t	   cloneNodeR  R  t   appendChildRl   t   getTableMisnestedNodePositiont   insertBeforet   reparentChildrent   insert(   R>   R}   t   outerLoopCountert   formattingElementt   afeIndext   furthestBlockRc   t   commonAncestort   bookmarkt   lastNodeR“   t   innerLoopCounterR"  t   cloneR  R&  (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR  ±  sŠ    

	!



	
	c         S` sÌ   |  j  j | d ƒ r& |  j  j ƒ  n  |  j  j d j | d k rd |  j j d i | d d 6ƒ n  |  j  j | d ƒ rÈ |  j  j j ƒ  } x) | j | d k r· |  j  j j ƒ  } q� W|  j  j ƒ  n  d  S(   Nu   nameiÿÿÿÿu   end-tag-too-early(	   R9   R  R  Rg   R@   RC   Rh   RÊ   t   clearActiveFormattingElements(   R>   R}   Rc   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR  T  s    !c         S` s[   |  j  j d i d d 6d d 6ƒ |  j j ƒ  |  j j t d d ƒ ƒ |  j j j ƒ  d  S(   Nu   unexpected-end-tag-treated-asu   bru   originalNameu
   br elementu   newNameu   StartTag(   RC   Rh   R9   R  R–   R¸   Rg   RÊ   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRÕ   `  s
    c         S` sä   xÝ |  j  j d  d  d … D]Â } | j | d k r« |  j  j d | d ƒ |  j  j d j | d k rˆ |  j j d i | d d 6ƒ n  x |  j  j j ƒ  | k r¦ q‹ WPq | j t k r |  j j d i | d d 6ƒ Pq q Wd  S(   Niÿÿÿÿu   nameR   u   unexpected-end-tag(	   R9   Rg   R@   R  RC   Rh   RÊ   R  R   (   R>   R}   R“   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR¿   g  s     !(5   R4   R5   RB   R  R  Rt   R  Rm   RÜ   RÝ   R×   RØ   RÞ   Rà   Rá   Râ   Rã   Rß   Rä   Rå   Ræ   Rç   Rè   Ré   Rê   Rë   Rí   Rì   Rî   Rï   Rð   Rñ   Rò   RÄ   Ró   Rö   Rô   Rõ   R÷   Rø   Rù   R¼   Rþ   Rú   Rû   Rü   Rý   Rÿ   R   R  R  RÕ   R¿   (    (   R§   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRÛ   ¢  sf   G			
																
																														£		t	   TextPhasec           ` sD   e  Z ‡  f d  †  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   c         ` se   ˆ  j  |  | | ƒ t j g  ƒ |  _ |  j |  j _ t j d |  j f g ƒ |  _ |  j |  j _ d  S(   Nu   script(	   RB   R
   Rº   R«   R¼   R½   t   endTagScriptR®   R¿   (   R>   RC   R9   (   R§   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRB   v  s    c         S` s   |  j  j | d ƒ d  S(   Nu   data(   R9   Rª   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRm   ~  s    c         S` sM   |  j  j d i |  j j d j d 6ƒ |  j j j ƒ  |  j  j |  j  _ t S(   Nu&   expected-named-closing-tag-but-got-eofiÿÿÿÿu   name(	   RC   Rh   R9   Rg   R@   RÊ   R—   RV   R[   (   R>   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRt   �  s
    c         S` s   t  s t d | d ƒ ‚ d  S(   Nu4   Tried to process start tag %s in RCDATA/RAWTEXT modeu   name(   RM   Ru   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR¼   ˆ  s    c         S` s=   |  j  j j ƒ  } | j d k s' t ‚ |  j j |  j _ d  S(   Nu   script(   R9   Rg   RÊ   R@   Ru   RC   R—   RV   (   R>   R}   R“   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR4  ‹  s    c         S` s&   |  j  j j ƒ  |  j j |  j _ d  S(   N(   R9   Rg   RÊ   RC   R—   RV   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR¿   ’  s    (   R4   R5   RB   Rm   Rt   R¼   R4  R¿   (    (   R§   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR3  u  s   				t   InTablePhasec           ` s¹   e  Z ‡  f d  †  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z d
 „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   c         ` sé   ˆ  j  |  | | ƒ t j d |  j f d |  j f d |  j f d |  j f d |  j f d |  j f d |  j	 f d |  j
 f d |  j f d |  j f g
 ƒ |  _ |  j |  j _ t j d |  j f d |  j f g ƒ |  _ |  j |  j _ d  S(   Nu   htmlu   captionu   colgroupu   colu   tbodyu   tfootu   theadu   tdu   thu   tru   tableu   styleu   scriptu   inputu   formu   body(   u   tbodyu   tfootu   thead(   u   tdu   thu   tr(   u   styleu   script(   u   bodyu   captionu   colu   colgroupu   htmlu   tbodyu   tdu   tfootu   thu   theadu   tr(   RB   R
   Rº   R­   t   startTagCaptiont   startTagColgroupt   startTagColt   startTagRowGroupt   startTagImplyTbodyRê   t   startTagStyleScriptRí   Rá   R«   R¼   R½   t   endTagTablet   endTagIgnoreR®   R¿   (   R>   RC   R9   (   R§   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRB   ˜  s$     c         S` s4   x- |  j  j d j d k r/ |  j  j j ƒ  q Wd  S(   Niÿÿÿÿu   tableu   html(   u   tableu   html(   R9   Rg   R@   RÊ   (   R>   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyt   clearStackToTableContext°  s    c         S` sB   |  j  j d j d k r, |  j j d ƒ n |  j j s> t ‚ d  S(   Niÿÿÿÿu   htmlu   eof-in-table(   R9   Rg   R@   RC   Rh   RK   Ru   (   R>   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRt   ¹  s    c         S` sH   |  j  j } |  j  j d |  j  _ | |  j  j _ |  j  j j | ƒ d  S(   Nu   inTableText(   RC   RV   R=   R—   Rn   (   R>   R}   R—   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRn   À  s    c         S` sH   |  j  j } |  j  j d |  j  _ | |  j  j _ |  j  j j | ƒ d  S(   Nu   inTableText(   RC   RV   R=   R—   Rm   (   R>   R}   R—   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRm   Æ  s    c         S` s3   t  |  j _ |  j j d j | ƒ t |  j _ d  S(   Nu   inBody(   R[   R9   t   insertFromTableRC   R=   Rm   RM   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRª   Ì  s    c         S` sG   |  j  ƒ  |  j j j t ƒ |  j j | ƒ |  j j d |  j _ d  S(   Nu	   inCaption(	   R>  R9   R  Rs   R	   R–   RC   R=   RV   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR6  Ó  s    
c         S` s4   |  j  ƒ  |  j j | ƒ |  j j d |  j _ d  S(   Nu   inColumnGroup(   R>  R9   R–   RC   R=   RV   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR7  Ù  s    
c         S` s   |  j  t d d ƒ ƒ | S(   Nu   colgroupu   StartTag(   R7  R¸   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR8  Þ  s    c         S` s4   |  j  ƒ  |  j j | ƒ |  j j d |  j _ d  S(   Nu   inTableBody(   R>  R9   R–   RC   R=   RV   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR9  â  s    
c         S` s   |  j  t d d ƒ ƒ | S(   Nu   tbodyu   StartTag(   R9  R¸   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR:  ç  s    c         S` sN   |  j  j d i d d 6d d 6ƒ |  j  j j t d ƒ ƒ |  j  j sJ | Sd  S(   Nu$   unexpected-start-tag-implies-end-tagu   tableu	   startNameu   endName(   RC   Rh   RV   Rp   R¸   RK   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRê   ë  s
    c         S` s   |  j  j d j | ƒ S(   Nu   inHead(   RC   R=   Ro   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR;  ò  s    c         S` sq   d | d k r` | d d j  t ƒ d k r` |  j j d ƒ |  j j | ƒ |  j j j ƒ  n |  j | ƒ d  S(   Nu   typeu   datau   hiddenu    unexpected-hidden-input-in-table(	   Rb   R   RC   Rh   R9   R–   Rg   RÊ   R¼   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRí   õ  s    c         S` s_   |  j  j d ƒ |  j j d  k r[ |  j j | ƒ |  j j d |  j _ |  j j j ƒ  n  d  S(   Nu   unexpected-form-in-tableiÿÿÿÿ(   RC   Rh   R9   R  R8   R–   Rg   RÊ   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRá   ÿ  s
    c         S` sQ   |  j  j d i | d d 6ƒ t |  j _ |  j  j d j | ƒ t |  j _ d  S(   Nu)   unexpected-start-tag-implies-table-voodoou   nameu   inBody(   RC   Rh   R[   R9   R?  R=   Ro   RM   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR¼     s    c         S` sâ   |  j  j d d d ƒr¿ |  j  j ƒ  |  j  j d j d k ro |  j j d i d d 6|  j  j d j d 6ƒ n  x- |  j  j d j d k rž |  j  j j ƒ  qr W|  j  j j ƒ  |  j j ƒ  n |  j j	 sÑ t
 ‚ |  j j ƒ  d  S(   Nu   tableR  iÿÿÿÿu   end-tag-too-early-namedu   gotNameu   expectedName(   R9   R  R  Rg   R@   RC   Rh   RÊ   RX   RK   Ru   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR<    s    
c         S` s"   |  j  j d i | d d 6ƒ d  S(   Nu   unexpected-end-tagu   name(   RC   Rh   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR=    s    c         S` sQ   |  j  j d i | d d 6ƒ t |  j _ |  j  j d j | ƒ t |  j _ d  S(   Nu'   unexpected-end-tag-implies-table-voodoou   nameu   inBody(   RC   Rh   R[   R9   R?  R=   Rp   RM   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR¿      s    (   R4   R5   RB   R>  Rt   Rn   Rm   Rª   R6  R7  R8  R9  R:  Rê   R;  Rí   Rá   R¼   R<  R=  R¿   (    (   R§   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR5  –  s&   														
				t   InTableTextPhasec           ` sV   e  Z ‡  f d  †  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 RS(   c         ` s)   ˆ  j  |  | | ƒ d  |  _ g  |  _ d  S(   N(   RB   R8   R—   t   characterTokens(   R>   RC   R9   (   R§   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRB   (  s    	c         S` s¦   d j  g  |  j D] } | d ^ q ƒ } t g  | D] } | t k ^ q3 ƒ r€ i t d d 6| d 6} |  j j d j | ƒ n | r™ |  j j | ƒ n  g  |  _ d  S(   Nu    u   datau
   Charactersu   typeu   inTable(	   t   joinRA  R  R   R   RC   R=   Rª   R9   (   R>   R!  RÏ   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyt   flushCharacters-  s    )%c         S` s   |  j  ƒ  |  j |  j _ | S(   N(   RC  R—   RC   RV   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRq   6  s    
c         S` s   |  j  ƒ  |  j |  j _ t S(   N(   RC  R—   RC   RV   R[   (   R>   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRt   ;  s    
c         S` s(   | d d k r d  S|  j  j | ƒ d  S(   Nu   datau    (   RA  Rs   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRm   @  s    c         S` s   |  j  j | ƒ d  S(   N(   RA  Rs   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRn   E  s    c         S` s   |  j  ƒ  |  j |  j _ | S(   N(   RC  R—   RC   RV   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRo   J  s    
c         S` s   |  j  ƒ  |  j |  j _ | S(   N(   RC  R—   RC   RV   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRp   O  s    
(
   R4   R5   RB   RC  Rq   Rt   Rm   Rn   Ro   Rp   (    (   R§   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR@  '  s   							t   InCaptionPhasec           ` sh   e  Z ‡  f d  †  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z RS(
   c         ` s•   ˆ  j  |  | | ƒ t j d |  j f d |  j f g ƒ |  _ |  j |  j _ t j d |  j f d |  j	 f d |  j
 f g ƒ |  _ |  j |  j _ d  S(   Nu   htmlu   captionu   colu   colgroupu   tbodyu   tdu   tfootu   thu   theadu   tru   tableu   body(	   u   captionu   colu   colgroupu   tbodyu   tdu   tfootu   thu   theadu   tr(
   u   bodyu   colu   colgroupu   htmlu   tbodyu   tdu   tfootu   thu   theadu   tr(   RB   R
   Rº   R­   t   startTagTableElementR«   R¼   R½   t   endTagCaptionR<  R=  R®   R¿   (   R>   RC   R9   (   R§   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRB   V  s      c         S` s   |  j  j d d d ƒS(   Nu   captionR  u   table(   R9   R  (   R>   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyt   ignoreEndTagCaptionh  s    c         S` s   |  j  j d j ƒ  d  S(   Nu   inBody(   RC   R=   Rt   (   R>   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRt   k  s    c         S` s   |  j  j d j | ƒ S(   Nu   inBody(   RC   R=   Rm   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRm   n  s    c         S` s@   |  j  j ƒ  |  j ƒ  } |  j  j j t d ƒ ƒ | s< | Sd  S(   Nu   caption(   RC   Rh   RG  RV   Rp   R¸   (   R>   R}   t   ignoreEndTag(    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRE  q  s
    c         S` s   |  j  j d j | ƒ S(   Nu   inBody(   RC   R=   Ro   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR¼   y  s    c         S` sì   |  j  ƒ  sÉ |  j j ƒ  |  j j d j d k rc |  j j d i d d 6|  j j d j d 6ƒ n  x- |  j j d j d k r’ |  j j j ƒ  qf W|  j j j ƒ  |  j j ƒ  |  j j	 d |  j _
 n |  j j sÛ t ‚ |  j j ƒ  d  S(   Niÿÿÿÿu   captionu$   expected-one-end-tag-but-got-anotheru   gotNameu   expectedNameu   inTable(   RG  R9   R  Rg   R@   RC   Rh   RÊ   R2  R=   RV   RK   Ru   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRF  |  s    
c         S` s@   |  j  j ƒ  |  j ƒ  } |  j  j j t d ƒ ƒ | s< | Sd  S(   Nu   caption(   RC   Rh   RG  RV   Rp   R¸   (   R>   R}   RH  (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR<  Ž  s
    c         S` s"   |  j  j d i | d d 6ƒ d  S(   Nu   unexpected-end-tagu   name(   RC   Rh   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR=  •  s    c         S` s   |  j  j d j | ƒ S(   Nu   inBody(   RC   R=   Rp   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR¿   ˜  s    (   R4   R5   RB   RG  Rt   Rm   RE  R¼   RF  R<  R=  R¿   (    (   R§   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRD  T  s   								t   InColumnGroupPhasec           ` s_   e  Z ‡  f d  †  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 RS(	   c         ` s‰   ˆ  j  |  | | ƒ t j d |  j f d |  j f g ƒ |  _ |  j |  j _ t j d |  j f d |  j	 f g ƒ |  _
 |  j |  j
 _ d  S(   Nu   htmlu   colu   colgroup(   RB   R
   Rº   R­   R8  R«   R¼   R½   t   endTagColgroupt	   endTagColR®   R¿   (   R>   RC   R9   (   R§   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRB   ž  s    c         S` s   |  j  j d j d k S(   Niÿÿÿÿu   html(   R9   Rg   R@   (   R>   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyt   ignoreEndTagColgroup­  s    c         S` s\   |  j  j d j d k r/ |  j j s+ t ‚ d  S|  j ƒ  } |  j t d ƒ ƒ | sX t	 Sd  S(   Niÿÿÿÿu   htmlu   colgroup(
   R9   Rg   R@   RC   RK   Ru   RL  RJ  R¸   R[   (   R>   RH  (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRt   °  s    c         S` s-   |  j  ƒ  } |  j t d ƒ ƒ | s) | Sd  S(   Nu   colgroup(   RL  RJ  R¸   (   R>   R}   RH  (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRm   º  s    c         S` s.   |  j  j | ƒ |  j  j j ƒ  t | d <d  S(   Nu   selfClosingAcknowledged(   R9   R–   Rg   RÊ   R[   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR8  À  s    c         S` s-   |  j  ƒ  } |  j t d ƒ ƒ | s) | Sd  S(   Nu   colgroup(   RL  RJ  R¸   (   R>   R}   RH  (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR¼   Å  s    c         S` sX   |  j  ƒ  r. |  j j s t ‚ |  j j ƒ  n& |  j j j ƒ  |  j j d |  j _	 d  S(   Nu   inTable(
   RL  RC   RK   Ru   Rh   R9   Rg   RÊ   R=   RV   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRJ  Ë  s
    c         S` s   |  j  j d i d d 6ƒ d  S(   Nu
   no-end-tagu   colu   name(   RC   Rh   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRK  Ô  s    c         S` s-   |  j  ƒ  } |  j t d ƒ ƒ | s) | Sd  S(   Nu   colgroup(   RL  RJ  R¸   (   R>   R}   RH  (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR¿   ×  s    (   R4   R5   RB   RL  Rt   Rm   R8  R¼   RJ  RK  R¿   (    (   R§   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRI  ›  s   		
						t   InTableBodyPhasec           ` sƒ   e  Z ‡  f d  †  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z d
 „  Z d „  Z d „  Z RS(   c         ` s­   ˆ  j  |  | | ƒ t j d |  j f d |  j f d |  j f d |  j f g ƒ |  _ |  j |  j _	 t j d |  j
 f d |  j f d |  j f g ƒ |  _ |  j |  j _	 d  S(   Nu   htmlu   tru   tdu   thu   captionu   colu   colgroupu   tbodyu   tfootu   theadu   tableu   body(   u   tdu   th(   u   captionu   colu   colgroupu   tbodyu   tfootu   thead(   u   tbodyu   tfootu   thead(   u   bodyu   captionu   colu   colgroupu   htmlu   tdu   thu   tr(   RB   R
   Rº   R­   t
   startTagTrt   startTagTableCellt   startTagTableOtherR«   R¼   R½   t   endTagTableRowGroupR<  R=  R®   R¿   (   R>   RC   R9   (   R§   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRB   ß  s     c         S` sb   x- |  j  j d j d k r/ |  j  j j ƒ  q W|  j  j d j d k r^ |  j j s^ t ‚ n  d  S(   Niÿÿÿÿu   tbodyu   tfootu   theadu   html(   u   tbodyu   tfootu   theadu   html(   R9   Rg   R@   RÊ   RC   RK   Ru   (   R>   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyt   clearStackToTableBodyContextó  s
    	c         S` s   |  j  j d j ƒ  d  S(   Nu   inTable(   RC   R=   Rt   (   R>   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRt   ý  s    c         S` s   |  j  j d j | ƒ S(   Nu   inTable(   RC   R=   Rn   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRn      s    c         S` s   |  j  j d j | ƒ S(   Nu   inTable(   RC   R=   Rm   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRm     s    c         S` s4   |  j  ƒ  |  j j | ƒ |  j j d |  j _ d  S(   Nu   inRow(   RR  R9   R–   RC   R=   RV   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRN    s    
c         S` s8   |  j  j d i | d d 6ƒ |  j t d d ƒ ƒ | S(   Nu   unexpected-cell-in-table-bodyu   nameu   tru   StartTag(   RC   Rh   RN  R¸   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRO    s    c         S` s™   |  j  j d d d ƒsH |  j  j d d d ƒsH |  j  j d d d ƒrv |  j ƒ  |  j t |  j  j d j ƒ ƒ | S|  j j sˆ t	 ‚ |  j j
 ƒ  d  S(   Nu   tbodyR  u   tableu   theadu   tfootiÿÿÿÿ(   R9   R  RR  RQ  R¸   Rg   R@   RC   RK   Ru   Rh   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRP    s    
c         S` s   |  j  j d j | ƒ S(   Nu   inTable(   RC   R=   Ro   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR¼     s    c         S` sq   |  j  j | d d d ƒrO |  j ƒ  |  j  j j ƒ  |  j j d |  j _ n |  j j d i | d d 6ƒ d  S(   Nu   nameR  u   tableu   inTableu    unexpected-end-tag-in-table-body(	   R9   R  RR  Rg   RÊ   RC   R=   RV   Rh   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRQ  "  s    
c         S` s™   |  j  j d d d ƒsH |  j  j d d d ƒsH |  j  j d d d ƒrv |  j ƒ  |  j t |  j  j d j ƒ ƒ | S|  j j sˆ t	 ‚ |  j j
 ƒ  d  S(   Nu   tbodyR  u   tableu   theadu   tfootiÿÿÿÿ(   R9   R  RR  RQ  R¸   Rg   R@   RC   RK   Ru   Rh   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR<  +  s    
c         S` s"   |  j  j d i | d d 6ƒ d  S(   Nu    unexpected-end-tag-in-table-bodyu   name(   RC   Rh   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR=  8  s    c         S` s   |  j  j d j | ƒ S(   Nu   inTable(   RC   R=   Rp   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR¿   <  s    (   R4   R5   RB   RR  Rt   Rn   Rm   RN  RO  RP  R¼   RQ  R<  R=  R¿   (    (   R§   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRM  Ý  s   	
											t
   InRowPhasec           ` sŒ   e  Z ‡  f d  †  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z d
 „  Z d „  Z d „  Z d „  Z RS(   c         ` s­   ˆ  j  |  | | ƒ t j d |  j f d |  j f d |  j f g ƒ |  _ |  j |  j _ t j d
 |  j	 f d |  j
 f d |  j f d |  j f g ƒ |  _ |  j |  j _ d  S(   Nu   htmlu   tdu   thu   captionu   colu   colgroupu   tbodyu   tfootu   theadu   tru   tableu   body(   u   tdu   th(   u   captionu   colu   colgroupu   tbodyu   tfootu   theadu   tr(   u   tbodyu   tfootu   thead(   u   bodyu   captionu   colu   colgroupu   htmlu   tdu   th(   RB   R
   Rº   R­   RO  RP  R«   R¼   R½   t   endTagTrR<  RQ  R=  R®   R¿   (   R>   RC   R9   (   R§   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRB   A  s     c         S` s[   xT |  j  j d j d k rV |  j j d i |  j  j d j d 6ƒ |  j  j j ƒ  q Wd  S(   Niÿÿÿÿu   tru   htmlu'   unexpected-implied-end-tag-in-table-rowu   name(   u   tru   html(   R9   Rg   R@   RC   Rh   RÊ   (   R>   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyt   clearStackToTableRowContextU  s    c         S` s   |  j  j d d d ƒS(   Nu   trR  u   table(   R9   R  (   R>   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyt   ignoreEndTagTr[  s    c         S` s   |  j  j d j ƒ  d  S(   Nu   inTable(   RC   R=   Rt   (   R>   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRt   _  s    c         S` s   |  j  j d j | ƒ S(   Nu   inTable(   RC   R=   Rn   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRn   b  s    c         S` s   |  j  j d j | ƒ S(   Nu   inTable(   RC   R=   Rm   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRm   e  s    c         S` sG   |  j  ƒ  |  j j | ƒ |  j j d |  j _ |  j j j t ƒ d  S(   Nu   inCell(	   RU  R9   R–   RC   R=   RV   R  Rs   R	   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRO  h  s    
c         S` s-   |  j  ƒ  } |  j t d ƒ ƒ | s) | Sd  S(   Nu   tr(   RV  RT  R¸   (   R>   R}   RH  (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRP  n  s    c         S` s   |  j  j d j | ƒ S(   Nu   inTable(   RC   R=   Ro   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR¼   u  s    c         S` sb   |  j  ƒ  s? |  j ƒ  |  j j j ƒ  |  j j d |  j _ n |  j j sQ t	 ‚ |  j j
 ƒ  d  S(   Nu   inTableBody(   RV  RU  R9   Rg   RÊ   RC   R=   RV   RK   Ru   Rh   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRT  x  s    
c         S` s-   |  j  ƒ  } |  j t d ƒ ƒ | s) | Sd  S(   Nu   tr(   RV  RT  R¸   (   R>   R}   RH  (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR<  ‚  s    c         S` sD   |  j  j | d d d ƒr3 |  j t d ƒ ƒ | S|  j j ƒ  d  S(   Nu   nameR  u   tableu   tr(   R9   R  RT  R¸   RC   Rh   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRQ  Š  s    c         S` s"   |  j  j d i | d d 6ƒ d  S(   Nu   unexpected-end-tag-in-table-rowu   name(   RC   Rh   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR=  ‘  s    c         S` s   |  j  j d j | ƒ S(   Nu   inTable(   RC   R=   Rp   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR¿   •  s    (   R4   R5   RB   RU  RV  Rt   Rn   Rm   RO  RP  R¼   RT  R<  RQ  R=  R¿   (    (   R§   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRS  ?  s   									
			t   InCellPhasec           ` sh   e  Z ‡  f d  †  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z RS(
   c         ` s•   ˆ  j  |  | | ƒ t j d |  j f d |  j f g ƒ |  _ |  j |  j _ t j d |  j f d |  j	 f d |  j
 f g ƒ |  _ |  j |  j _ d  S(   Nu   htmlu   captionu   colu   colgroupu   tbodyu   tdu   tfootu   thu   theadu   tru   bodyu   table(	   u   captionu   colu   colgroupu   tbodyu   tdu   tfootu   thu   theadu   tr(   u   tdu   th(   u   bodyu   captionu   colu   colgroupu   html(   u   tableu   tbodyu   tfootu   theadu   tr(   RB   R
   Rº   R­   RP  R«   R¼   R½   t   endTagTableCellR=  t   endTagImplyR®   R¿   (   R>   RC   R9   (   R§   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRB   š  s     c         S` s`   |  j  j d d d ƒr. |  j t d ƒ ƒ n. |  j  j d d d ƒr\ |  j t d ƒ ƒ n  d  S(   Nu   tdR  u   tableu   th(   R9   R  RX  R¸   (   R>   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyt	   closeCell«  s    c         S` s   |  j  j d j ƒ  d  S(   Nu   inBody(   RC   R=   Rt   (   R>   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRt   ²  s    c         S` s   |  j  j d j | ƒ S(   Nu   inBody(   RC   R=   Rm   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRm   µ  s    c         S` sa   |  j  j d d d ƒs0 |  j  j d d d ƒr> |  j ƒ  | S|  j j sP t ‚ |  j j ƒ  d  S(   Nu   tdR  u   tableu   th(   R9   R  RZ  RC   RK   Ru   Rh   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRP  ¸  s    
c         S` s   |  j  j d j | ƒ S(   Nu   inBody(   RC   R=   Ro   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR¼   Â  s    c         S` sü   |  j  j | d d d ƒrÚ |  j  j | d ƒ |  j  j d j | d k r¤ |  j j d i | d d 6ƒ xF t r  |  j  j j ƒ  } | j | d k rn Pqn qn Wn |  j  j j ƒ  |  j  j	 ƒ  |  j j
 d |  j _ n |  j j d i | d d 6ƒ d  S(   Nu   nameR  u   tableiÿÿÿÿu   unexpected-cell-end-tagu   inRowu   unexpected-end-tag(   R9   R  R  Rg   R@   RC   Rh   R[   RÊ   R2  R=   RV   (   R>   R}   R“   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRX  Å  s    	c         S` s"   |  j  j d i | d d 6ƒ d  S(   Nu   unexpected-end-tagu   name(   RC   Rh   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR=  Ö  s    c         S` s;   |  j  j | d d d ƒr* |  j ƒ  | S|  j j ƒ  d  S(   Nu   nameR  u   table(   R9   R  RZ  RC   Rh   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRY  Ù  s    
c         S` s   |  j  j d j | ƒ S(   Nu   inBody(   RC   R=   Rp   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR¿   á  s    (   R4   R5   RB   RZ  Rt   Rm   RP  R¼   RX  R=  RY  R¿   (    (   R§   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRW  ˜  s   				
				t   InSelectPhasec           ` sƒ   e  Z ‡  f d  †  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z d
 „  Z d „  Z d „  Z RS(   c         ` sÅ   ˆ  j  |  | | ƒ t j d |  j f d |  j f d |  j f d |  j f d	 |  j f d |  j f g ƒ |  _	 |  j
 |  j	 _ t j d |  j f d |  j f d |  j f g ƒ |  _ |  j |  j _ d  S(
   Nu   htmlu   optionu   optgroupu   selectu   inputu   keygenu   textareau   script(   u   inputu   keygenu   textarea(   RB   R
   Rº   R­   t   startTagOptiont   startTagOptgroupRô   Rí   RÅ   R«   R¼   R½   t   endTagOptiont   endTagOptgroupt   endTagSelectR®   R¿   (   R>   RC   R9   (   R§   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRB   å  s    c         S` sB   |  j  j d j d k r, |  j j d ƒ n |  j j s> t ‚ d  S(   Niÿÿÿÿu   htmlu   eof-in-select(   R9   Rg   R@   RC   Rh   RK   Ru   (   R>   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRt   ú  s    c         S` s,   | d d k r d  S|  j  j | d ƒ d  S(   Nu   datau    (   R9   Rª   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRm    	  s    c         S` s@   |  j  j d j d k r, |  j  j j ƒ  n  |  j  j | ƒ d  S(   Niÿÿÿÿu   option(   R9   Rg   R@   RÊ   R–   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR\  	  s    c         S` sl   |  j  j d j d k r, |  j  j j ƒ  n  |  j  j d j d k rX |  j  j j ƒ  n  |  j  j | ƒ d  S(   Niÿÿÿÿu   optionu   optgroup(   R9   Rg   R@   RÊ   R–   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR]  	  s
    c         S` s'   |  j  j d ƒ |  j t d ƒ ƒ d  S(   Nu   unexpected-select-in-selectu   select(   RC   Rh   R`  R¸   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRô   	  s    c         S` sU   |  j  j d ƒ |  j j d d d ƒr? |  j t d ƒ ƒ | S|  j  j sQ t ‚ d  S(   Nu   unexpected-input-in-selectu   selectR  (   RC   Rh   R9   R  R`  R¸   RK   Ru   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRí   	  s
    c         S` s   |  j  j d j | ƒ S(   Nu   inHead(   RC   R=   Ro   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRÅ   	  s    c         S` s"   |  j  j d i | d d 6ƒ d  S(   Nu   unexpected-start-tag-in-selectu   name(   RC   Rh   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR¼   !	  s    c         S` sJ   |  j  j d j d k r, |  j  j j ƒ  n |  j j d i d d 6ƒ d  S(   Niÿÿÿÿu   optionu   unexpected-end-tag-in-selectu   name(   R9   Rg   R@   RÊ   RC   Rh   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR^  %	  s    c         S` s�   |  j  j d j d k rE |  j  j d j d k rE |  j  j j ƒ  n  |  j  j d j d k rq |  j  j j ƒ  n |  j j d i d d 6ƒ d  S(   Niÿÿÿÿu   optioniþÿÿÿu   optgroupu   unexpected-end-tag-in-selectu   name(   R9   Rg   R@   RÊ   RC   Rh   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR_  ,	  s    c         S` s…   |  j  j d d d ƒrb |  j  j j ƒ  } x% | j d k rQ |  j  j j ƒ  } q- W|  j j ƒ  n |  j j st t ‚ |  j j	 ƒ  d  S(   Nu   selectR  (
   R9   R  Rg   RÊ   R@   RC   RX   RK   Ru   Rh   (   R>   R}   R“   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR`  9	  s    c         S` s"   |  j  j d i | d d 6ƒ d  S(   Nu   unexpected-end-tag-in-selectu   name(   RC   Rh   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR¿   D	  s    (   R4   R5   RB   Rt   Rm   R\  R]  Rô   Rí   RÅ   R¼   R^  R_  R`  R¿   (    (   R§   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR[  ä  s   											t   InSelectInTablePhasec           ` sM   e  Z ‡  f d  †  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   c      	   ` sq   ˆ  j  |  | | ƒ t j d	 |  j f g ƒ |  _ |  j |  j _ t j d
 |  j f g ƒ |  _ |  j	 |  j _ d  S(   Nu   captionu   tableu   tbodyu   tfootu   theadu   tru   tdu   th(   u   captionu   tableu   tbodyu   tfootu   theadu   tru   tdu   th(   u   captionu   tableu   tbodyu   tfootu   theadu   tru   tdu   th(
   RB   R
   Rº   Rê   R«   R¼   R½   R<  R®   R¿   (   R>   RC   R9   (   R§   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRB   I	  s    c         S` s   |  j  j d j ƒ  d  S(   Nu   inSelect(   RC   R=   Rt   (   R>   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRt   X	  s    c         S` s   |  j  j d j | ƒ S(   Nu   inSelect(   RC   R=   Rm   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRm   [	  s    c         S` s5   |  j  j d i | d d 6ƒ |  j t d ƒ ƒ | S(   Nu5   unexpected-table-element-start-tag-in-select-in-tableu   nameu   select(   RC   Rh   R¿   R¸   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRê   ^	  s    c         S` s   |  j  j d j | ƒ S(   Nu   inSelect(   RC   R=   Ro   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR¼   c	  s    c         S` sU   |  j  j d i | d d 6ƒ |  j j | d d d ƒrQ |  j t d ƒ ƒ | Sd  S(   Nu3   unexpected-table-element-end-tag-in-select-in-tableu   nameR  u   tableu   select(   RC   Rh   R9   R  R¿   R¸   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR<  f	  s    c         S` s   |  j  j d j | ƒ S(   Nu   inSelect(   RC   R=   Rp   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR¿   l	  s    (	   R4   R5   RB   Rt   Rm   Rê   R¼   R<  R¿   (    (   R§   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRa  H	  s   					t   InForeignContentPhasec        -   ` sÑ   e  Z e d  d d d d d d d d d	 d
 d d d d d d d d d d d d d d d d d d d d d d  d! d" d# d$ d% d& d' d( d) d* d+ g, ƒ Z ‡  f d, †  Z d- „  Z ‡  f d. †  Z d/ „  Z d0 „  Z RS(1   u   bu   bigu
   blockquoteu   bodyu   bru   centeru   codeu   ddu   divu   dlu   dtu   emu   embedu   h1u   h2u   h3u   h4u   h5u   h6u   headu   hru   iu   imgu   liu   listingu   menuu   metau   nobru   olu   pu   preu   rubyu   su   smallu   spanu   strongu   strikeu   subu   supu   tableu   ttu   uu   ulu   varc         ` s   ˆ  j  |  | | ƒ d  S(   N(   RB   (   R>   RC   R9   (   R§   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRB   y	  s    c         S` s+  i$ d d 6d d 6d d 6d d 6d	 d
 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d  6d! d" 6d# d$ 6d% d& 6d' d( 6d) d* 6d+ d, 6d- d. 6d/ d0 6d1 d2 6d3 d4 6d5 d6 6d7 d8 6d9 d: 6d; d< 6d= d> 6d? d@ 6dA dB 6dC dD 6dE dF 6dG dH 6} | dI | k r'| | dI | dI <n  d  S(J   Nu   altGlyphu   altglyphu   altGlyphDefu   altglyphdefu   altGlyphItemu   altglyphitemu   animateColoru   animatecoloru   animateMotionu   animatemotionu   animateTransformu   animatetransformu   clipPathu   clippathu   feBlendu   feblendu   feColorMatrixu   fecolormatrixu   feComponentTransferu   fecomponenttransferu   feCompositeu   fecompositeu   feConvolveMatrixu   feconvolvematrixu   feDiffuseLightingu   fediffuselightingu   feDisplacementMapu   fedisplacementmapu   feDistantLightu   fedistantlightu   feFloodu   fefloodu   feFuncAu   fefuncau   feFuncBu   fefuncbu   feFuncGu   fefuncgu   feFuncRu   fefuncru   feGaussianBluru   fegaussianbluru   feImageu   feimageu   feMergeu   femergeu   feMergeNodeu   femergenodeu   feMorphologyu   femorphologyu   feOffsetu   feoffsetu   fePointLightu   fepointlightu   feSpecularLightingu   fespecularlightingu   feSpotLightu   fespotlightu   feTileu   fetileu   feTurbulenceu   feturbulenceu   foreignObjectu   foreignobjectu   glyphRefu   glyphrefu   linearGradientu   lineargradientu   radialGradientu   radialgradientu   textPathu   textpathu   name(    (   R>   R}   t   replacements(    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyt   adjustSVGTagNames|	  sL    

c         ` sf   | d d k r d | d <n5 |  j  j rR t d „  | d Dƒ ƒ rR t |  j  _ n  ˆ  j |  | ƒ d  S(   Nu   datau    u   ï¿½c         s` s   |  ] } | t  k Vq d  S(   N(   R   (   Rœ   R  (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pys	   <genexpr>©	  s    (   RC   R\   R  RM   Rm   (   R>   R}   (   R§   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRm   ¥	  s    c         S` sŸ  |  j  j d } | d |  j k s\ | d d k rî t | d j ƒ  ƒ t d d d g ƒ @rî |  j j d i | d d 6ƒ xm |  j  j d j |  j  j k ré |  j j	 |  j  j d ƒ ré |  j j
 |  j  j d ƒ ré |  j  j j ƒ  q} W| S| j t d	 k r|  j j | ƒ n3 | j t d
 k rG|  j | ƒ |  j j | ƒ n  |  j j | ƒ | j | d <|  j  j | ƒ | d r›|  j  j j ƒ  t | d <n  d  S(   Niÿÿÿÿu   nameu   fontu   datau   coloru   faceu   sizeu*   unexpected-html-element-in-foreign-contentu   mathmlu   svgu	   namespaceu   selfClosingu   selfClosingAcknowledged(   R9   Rg   t   breakoutElementst   sett   keysRC   Rh   R`   Rk   Rd   Re   RÊ   R   R   Rd  R   R   R–   R[   (   R>   R}   R€   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRo   ­	  s.    )
c         S` sZ  t  |  j j ƒ d } |  j j d } | j j t ƒ | d k rc |  j j d i | d d 6ƒ n  xð t rU| j j t ƒ | d k r|  j j	 |  j j
 d k rÌ |  j j	 j ƒ  |  j j	 j |  j _	 n  x. |  j j j ƒ  | k rü |  j j sÏ t ‚ qÏ Wd  } Pn  | d 8} |  j j | } | j |  j j k r<qf qf |  j j	 j | ƒ } Pqf W| S(   Ni   iÿÿÿÿu   nameu   unexpected-end-tagu   inTableText(   Rj   R9   Rg   R@   Rb   R   RC   Rh   R[   RV   R=   RC  R—   RÊ   Ru   R8   R`   Rk   Rp   (   R>   R}   t	   nodeIndexR“   R   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRp   È	  s(    !	
(	   R4   R5   Rl   Re  RB   Rd  Rm   Ro   Rp   (    (   R§   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRb  o	  s   	)	t   AfterBodyPhasec           ` sV   e  Z ‡  f d  †  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 RS(   c         ` sq   ˆ  j  |  | | ƒ t j d |  j f g ƒ |  _ |  j |  j _ t j d |  j f g ƒ |  _ |  j	 |  j _ d  S(   Nu   html(
   RB   R
   Rº   R­   R«   R¼   R½   Rû   R®   R¿   (   R>   RC   R9   (   R§   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRB   ã	  s    c         S` s   d  S(   N(    (   R>   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRt   î	  s    c         S` s!   |  j  j | |  j  j d ƒ d  S(   Ni    (   R9   R©   Rg   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRq   ò	  s    c         S` s*   |  j  j d ƒ |  j  j d |  j  _ | S(   Nu   unexpected-char-after-bodyu   inBody(   RC   Rh   R=   RV   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRm   ÷	  s    c         S` s   |  j  j d j | ƒ S(   Nu   inBody(   RC   R=   Ro   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR­   ü	  s    c         S` s8   |  j  j d i | d d 6ƒ |  j  j d |  j  _ | S(   Nu   unexpected-start-tag-after-bodyu   nameu   inBody(   RC   Rh   R=   RV   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR¼   ÿ	  s    c         S` s9   |  j  j r |  j  j d ƒ n |  j  j d |  j  _ d  S(   Nu'   unexpected-end-tag-after-body-innerhtmlu   afterAfterBody(   RC   RK   Rh   R=   RV   (   R>   R@   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRû   
  s    c         S` s8   |  j  j d i | d d 6ƒ |  j  j d |  j  _ | S(   Nu   unexpected-end-tag-after-bodyu   nameu   inBody(   RC   Rh   R=   RV   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR¿   
  s    (
   R4   R5   RB   Rt   Rq   Rm   R­   R¼   Rû   R¿   (    (   R§   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRi  â	  s   						t   InFramesetPhasec           ` s_   e  Z ‡  f d  †  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 RS(	   c         ` s•   ˆ  j  |  | | ƒ t j d |  j f d |  j f d |  j f d |  j f g ƒ |  _ |  j |  j _	 t j d |  j
 f g ƒ |  _ |  j |  j _	 d  S(   Nu   htmlu   framesetu   frameu   noframes(   RB   R
   Rº   R­   RØ   t   startTagFramet   startTagNoframesR«   R¼   R½   t   endTagFramesetR®   R¿   (   R>   RC   R9   (   R§   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRB   
  s    c         S` sB   |  j  j d j d k r, |  j j d ƒ n |  j j s> t ‚ d  S(   Niÿÿÿÿu   htmlu   eof-in-frameset(   R9   Rg   R@   RC   Rh   RK   Ru   (   R>   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRt   #
  s    c         S` s   |  j  j d ƒ d  S(   Nu   unexpected-char-in-frameset(   RC   Rh   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRm   )
  s    c         S` s   |  j  j | ƒ d  S(   N(   R9   R–   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRØ   ,
  s    c         S` s$   |  j  j | ƒ |  j  j j ƒ  d  S(   N(   R9   R–   Rg   RÊ   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRk  /
  s    c         S` s   |  j  j d j | ƒ S(   Nu   inBody(   RC   R=   Ro   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRl  3
  s    c         S` s"   |  j  j d i | d d 6ƒ d  S(   Nu    unexpected-start-tag-in-framesetu   name(   RC   Rh   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR¼   6
  s    c         S` s   |  j  j d j d k r, |  j j d ƒ n |  j  j j ƒ  |  j j r{ |  j  j d j d k r{ |  j j d |  j _ n  d  S(   Niÿÿÿÿu   htmlu)   unexpected-frameset-in-frameset-innerhtmlu   framesetu   afterFrameset(	   R9   Rg   R@   RC   Rh   RÊ   RK   R=   RV   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRm  :
  s    c         S` s"   |  j  j d i | d d 6ƒ d  S(   Nu   unexpected-end-tag-in-framesetu   name(   RC   Rh   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR¿   F
  s    (   R4   R5   RB   Rt   Rm   RØ   Rk  Rl  R¼   Rm  R¿   (    (   R§   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRj  
  s   							t   AfterFramesetPhasec           ` sM   e  Z ‡  f d  †  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   c         ` s}   ˆ  j  |  | | ƒ t j d |  j f d |  j f g ƒ |  _ |  j |  j _ t j d |  j f g ƒ |  _	 |  j
 |  j	 _ d  S(   Nu   htmlu   noframes(   RB   R
   Rº   R­   Rl  R«   R¼   R½   Rû   R®   R¿   (   R>   RC   R9   (   R§   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRB   L
  s    c         S` s   d  S(   N(    (   R>   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRt   Z
  s    c         S` s   |  j  j d ƒ d  S(   Nu   unexpected-char-after-frameset(   RC   Rh   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRm   ^
  s    c         S` s   |  j  j d j | ƒ S(   Nu   inHead(   RC   R=   Ro   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRl  a
  s    c         S` s"   |  j  j d i | d d 6ƒ d  S(   Nu#   unexpected-start-tag-after-framesetu   name(   RC   Rh   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR¼   d
  s    c         S` s   |  j  j d |  j  _ d  S(   Nu   afterAfterFrameset(   RC   R=   RV   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRû   h
  s    c         S` s"   |  j  j d i | d d 6ƒ d  S(   Nu!   unexpected-end-tag-after-framesetu   name(   RC   Rh   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR¿   k
  s    (	   R4   R5   RB   Rt   Rm   Rl  R¼   Rû   R¿   (    (   R§   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRn  J
  s   					t   AfterAfterBodyPhasec           ` sV   e  Z ‡  f d  †  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 RS(   c         ` sD   ˆ  j  |  | | ƒ t j d |  j f g ƒ |  _ |  j |  j _ d  S(   Nu   html(   RB   R
   Rº   R­   R«   R¼   R½   (   R>   RC   R9   (   R§   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRB   p
  s    c         S` s   d  S(   N(    (   R>   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRt   x
  s    c         S` s   |  j  j | |  j  j ƒ d  S(   N(   R9   R©   R°   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRq   {
  s    c         S` s   |  j  j d j | ƒ S(   Nu   inBody(   RC   R=   Rn   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRn   ~
  s    c         S` s*   |  j  j d ƒ |  j  j d |  j  _ | S(   Nu   expected-eof-but-got-charu   inBody(   RC   Rh   R=   RV   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRm   �
  s    c         S` s   |  j  j d j | ƒ S(   Nu   inBody(   RC   R=   Ro   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR­   †
  s    c         S` s8   |  j  j d i | d d 6ƒ |  j  j d |  j  _ | S(   Nu   expected-eof-but-got-start-tagu   nameu   inBody(   RC   Rh   R=   RV   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR¼   ‰
  s    c         S` s8   |  j  j d i | d d 6ƒ |  j  j d |  j  _ | S(   Nu   expected-eof-but-got-end-tagu   nameu   inBody(   RC   Rh   R=   RV   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRp   �
  s    (
   R4   R5   RB   Rt   Rq   Rn   Rm   R­   R¼   Rp   (    (   R§   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRo  o
  s   						t   AfterAfterFramesetPhasec           ` s_   e  Z ‡  f d  †  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 RS(	   c         ` sP   ˆ  j  |  | | ƒ t j d |  j f d |  j f g ƒ |  _ |  j |  j _ d  S(   Nu   htmlu   noframes(   RB   R
   Rº   R­   t   startTagNoFramesR«   R¼   R½   (   R>   RC   R9   (   R§   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRB   –
  s
    c         S` s   d  S(   N(    (   R>   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRt   Ÿ
  s    c         S` s   |  j  j | |  j  j ƒ d  S(   N(   R9   R©   R°   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRq   ¢
  s    c         S` s   |  j  j d j | ƒ S(   Nu   inBody(   RC   R=   Rn   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRn   ¥
  s    c         S` s   |  j  j d ƒ d  S(   Nu   expected-eof-but-got-char(   RC   Rh   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRm   ¨
  s    c         S` s   |  j  j d j | ƒ S(   Nu   inBody(   RC   R=   Ro   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR­   «
  s    c         S` s   |  j  j d j | ƒ S(   Nu   inHead(   RC   R=   Ro   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRq  ®
  s    c         S` s"   |  j  j d i | d d 6ƒ d  S(   Nu   expected-eof-but-got-start-tagu   name(   RC   Rh   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR¼   ±
  s    c         S` s"   |  j  j d i | d d 6ƒ d  S(   Nu   expected-eof-but-got-end-tagu   name(   RC   Rh   (   R>   R}   (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRp   µ
  s    (   R4   R5   RB   Rt   Rq   Rn   Rm   R­   Rq  R¼   Rp   (    (   R§   (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRp  •
  s   								u   initialu
   beforeHtmlu
   beforeHeadu   inHeadu   inHeadNoscriptu	   afterHeadu   inBodyu   textu   inTableu   inTableTextu	   inCaptionu   inColumnGroupu   inTableBodyu   inRowu   inCellu   inSelectu   inSelectInTableu   inForeignContentu	   afterBodyu
   inFramesetu   afterFramesetu   afterAfterBodyu   afterAfterFrameset(   R   (   R?   RO   R¦   R¯   R¶   R¹   RÁ   RÒ   RÖ   RÛ   R3  R5  R@  RD  RI  RM  RS  RW  R[  Ra  Rb  Ri  Rj  Rn  Ro  Rp  (    (   R§   s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR<   œ  sh    		%)€#.g@Cÿ ÿ Õ!‘-GBbYLd's/9%&%c         ` sQ   t  |  d ƒ t  ˆ  ƒ @} | rM t ‡  f d †  |  d j ƒ  Dƒ ƒ |  d <n  d  S(   Nu   datac         3` s-   |  ]# \ } } ˆ  j  | | ƒ | f Vq d  S(   N(   Ri   (   Rœ   t   kt   v(   Rc  (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pys	   <genexpr>Ù
  s   (   R   R   R'   (   R}   Rc  t   needs_adjustment(    (   Rc  s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyRŽ   Ö
  s    u   EndTagc         C` s9   | d  k r i  } n  i t | d 6|  d 6| d 6| d 6S(   Nu   typeu   nameu   datau   selfClosing(   R8   R   (   R@   R+   Ra   R  (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR¸   Ý
  s    	R‰   c           B` s   e  Z d  Z RS(   u   Error in parsed document(   R4   R5   Rš   (    (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyR‰   å
  s   (1   t
   __future__R    R   R   t   pip._vendor.sixR   R   R)   t   collectionsR   t    R   R   R   t   treebuilders.baseR	   R
   t	   constantsR   R   R   R   R   R   R   R   R   R   R   R   R�   R   R   R   R   R[   R   R%   R6   t   objectR   t   memoizeR<   RŽ   R8   RM   R¸   t	   ExceptionR‰   (    (    (    s=   /tmp/pip-build-sZz8gW/pip/pip/_vendor/html5lib/html5parser.pyt   <module>   s8   j	ÿ Fÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ C	