ó
^\kdc           @` s�   d  d l  m Z m Z m Z d  d l m Z y d  d l j j Z	 Wn# e
 k
 rg d  d l j j Z	 n Xd e f d „  ƒ  YZ d „  Z d „  Z d „  Z d S(	   i    (   t   absolute_importt   divisiont   unicode_literals(   t
   ModuleTypeNt   MethodDispatcherc           B` s#   e  Z d  Z d d „ Z d „  Z RS(   up  Dict with 2 special properties:

    On initiation, keys that are lists, sets or tuples are converted to
    multiple keys so accessing any one of the items in the original
    list-like object returns the matching value

    md = MethodDispatcher({("foo", "bar"):"baz"})
    md["foo"] == "baz"

    A default value which can be set through the default attribute.
    c         C` s’   g  } xl | D]d \ } } t  | ƒ t t t t f k r^ x7 | D] } | j | | f ƒ q> Wq | j | | f ƒ q Wt j |  | ƒ d  |  _	 d  S(   N(
   t   typet   listt   tuplet	   frozensett   sett   appendt   dictt   __init__t   Nonet   default(   t   selft   itemst   _dictEntriest   namet   valuet   item(    (    sA   /var/www/testScraper/venv/build/pip/pip/_vendor/html5lib/utils.pyR      s    c         C` s   t  j |  | |  j ƒ S(   N(   R   t   getR   (   R   t   key(    (    sA   /var/www/testScraper/venv/build/pip/pip/_vendor/html5lib/utils.pyt   __getitem__&   s    (    (   t   __name__t
   __module__t   __doc__R   R   (    (    (    sA   /var/www/testScraper/venv/build/pip/pip/_vendor/html5lib/utils.pyR      s   c         C` sh   t  |  ƒ d k og t |  d ƒ d k og t |  d ƒ d k og t |  d ƒ d k og t |  d ƒ d k S(   Ni   i    i Ø  iÿÛ  i   i Ü  iÿß  (   t   lent   ord(   t   data(    (    sA   /var/www/testScraper/venv/build/pip/pip/_vendor/html5lib/utils.pyt   isSurrogatePair-   s    ,c         C` s2   d t  |  d ƒ d d t  |  d ƒ d } | S(   Ni   i    i Ø  i   i   i Ü  (   R   (   R   t   char_val(    (    sA   /var/www/testScraper/venv/build/pip/pip/_vendor/html5lib/utils.pyt   surrogatePairToCodepoint3   s    c         ` s   i  ‰ ‡  ‡ f d †  } | S(   Nc         ` s‰   t  t j t d ƒ ƒ r( d |  j } n d |  j } | ˆ k rI ˆ | St | ƒ } ˆ  |  | | Ž } | j j | ƒ | ˆ | <| Sd  S(   Nu    u   _%s_factorys   _%s_factory(   t
   isinstanceR   R   R   t   __dict__t   update(   t
   baseModulet   argst   kwargsR   t   modt   objs(   t   factoryt   moduleCache(    sA   /var/www/testScraper/venv/build/pip/pip/_vendor/html5lib/utils.pyt   moduleFactory?   s    
(    (   R)   R+   (    (   R)   R*   sA   /var/www/testScraper/venv/build/pip/pip/_vendor/html5lib/utils.pyt   moduleFactoryFactory<   s    (   t
   __future__R    R   R   t   typesR   t   xml.etree.cElementTreet   etreet   cElementTreet   default_etreet   ImportErrort   xml.etree.ElementTreet   ElementTreeR   R   R   R    R,   (    (    (    sA   /var/www/testScraper/venv/build/pip/pip/_vendor/html5lib/utils.pyt   <module>   s   "			