ó
àÆ÷Xc           @` ss   d  d l  m Z m Z m Z d  d l Z d  d l Z d  d l Z d e j f d „  ƒ  YZ d e f d „  ƒ  YZ	 d S(   i    (   t   absolute_importt   print_functiont   divisionNt
   frozendictc           B` s\   e  Z d  Z e Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d „  Z d „  Z RS(	   sä   
    An immutable wrapper around dictionaries that implements the complete :py:class:`collections.Mapping`
    interface. It can be used as a drop-in replacement for dictionaries where immutability and ordering are desired.
    c         O` s"   |  j  | | Ž  |  _ d  |  _ d  S(   N(   t   dict_clst   _dictt   Nonet   _hash(   t   selft   argst   kwargs(    (    s6   /tmp/pip-build-X4mzal/theano/theano/misc/frozendict.pyt   __init__   s    c         C` s   |  j  | S(   N(   R   (   R   t   key(    (    s6   /tmp/pip-build-X4mzal/theano/theano/misc/frozendict.pyt   __getitem__   s    c         C` s   | |  j  k S(   N(   R   (   R   R   (    (    s6   /tmp/pip-build-X4mzal/theano/theano/misc/frozendict.pyt   __contains__   s    c         K` s   |  j  |  |  S(   N(   t	   __class__(   R   t   add_or_replace(    (    s6   /tmp/pip-build-X4mzal/theano/theano/misc/frozendict.pyt   copy   s    c         C` s   t  |  j ƒ S(   N(   t   iterR   (   R   (    (    s6   /tmp/pip-build-X4mzal/theano/theano/misc/frozendict.pyt   __iter__   s    c         C` s   t  |  j ƒ S(   N(   t   lenR   (   R   (    (    s6   /tmp/pip-build-X4mzal/theano/theano/misc/frozendict.pyt   __len__!   s    c         C` s   d |  j  j |  j f S(   Ns   <%s %r>(   R   t   __name__R   (   R   (    (    s6   /tmp/pip-build-X4mzal/theano/theano/misc/frozendict.pyt   __repr__$   s    c         C` sI   |  j  d  k rB t t |  j ƒ  ƒ } t j t j | d ƒ |  _  n  |  j  S(   Ni    (	   R   R   t   mapt   hasht   itemst	   functoolst   reducet   operatort   xor(   R   t   hashes(    (    s6   /tmp/pip-build-X4mzal/theano/theano/misc/frozendict.pyt   __hash__'   s    (   R   t
   __module__t   __doc__t   dictR   R   R   R   R   R   R   R   R    (    (    (    s6   /tmp/pip-build-X4mzal/theano/theano/misc/frozendict.pyR   	   s   							t   FrozenOrderedDictc           B` s   e  Z d  Z e j Z RS(   s8   
    A FrozenDict subclass that maintains key order
    (   R   R!   R"   t   collectionst   OrderedDictR   (    (    (    s6   /tmp/pip-build-X4mzal/theano/theano/misc/frozendict.pyR$   /   s   (
   t
   __future__R    R   R   R%   R   R   t   MappingR   R$   (    (    (    s6   /tmp/pip-build-X4mzal/theano/theano/misc/frozendict.pyt   <module>   s
   &