
i^c           @   s  d  Z  d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z y& d d l m Z m	 Z	 e e
 f Z Wn e
 f Z n Xd 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 e e e e f Z e d
 d d  Z e d d d  Z e Z d e  f d     YZ! d d l" m# Z# e j$ d  Z% d   Z& e   Z' d   Z( d   Z) d   Z* d   Z+ d   Z, d   Z- d   Z. d f  d     YZ/ e0 d  Z1 d   Z2 d e3 f d      YZ4 d! e3 f d"     YZ5 e5 Z6 d# e3 f d$     YZ7 d% e7 f d&     YZ8 d' e3 f d(     YZ9 d)   Z: d* e
 f d+     YZ; d, e; f d-     YZ< d.   Z= d/   Z> d0   Z? d1   Z@ d2 e7 f d3     YZA d4 eA f d5     YZB d6 eA f d7     YZC d8 eA f d9     YZD d: e jE e; e3  f d;     YZF d< e jE e< eF  f d=     YZG d> e8 f d?     YZH d@ eH f dA     YZI dB eH f dC     YZJ dD e3 f dE     YZK dF eK eI f dG     YZL dH eK eJ f dI     YZM dJ eH f dK     YZN dL e8 f dM     YZO dN e8 f dO     YZP dP   ZQ dQ e8 f dR     YZR dS eR f dT     YZS e jT rdU e8 f dV     YZU dW eU f dX     YZV dY e8 f dZ     YZW n eR eS f \ ZU ZV eR ZW d[ e8 f d\     YZX d] eX f d^     YZY d_ e8 f d`     YZZ da eZ f db     YZ[ dc e8 f dd     YZ\ de e\ f df     YZ] dg e8 f dh     YZ^ di e^ f dj     YZ_ dk e8 f dl     YZ` dm e` f dn     YZa do e8 f dp     YZb dq eb f dr     YZc ds e8 f dt     YZd du ed f dv     YZe dw eJ f dx     YZf dy ef f dz     YZg d{ eg f d|     YZh d} ef f d~     YZi d eJ f d     YZj d e8 f d     YZk d e8 f d     YZl d e8 f d     YZm d S(   s  
A lightweight Traits like module.

This is designed to provide a lightweight, simple, pure Python version of
many of the capabilities of enthought.traits.  This includes:

* Validation
* Type specification with defaults
* Static and dynamic notification
* Basic predefined types
* An API that is similar to enthought.traits

We don't support:

* Delegation
* Automatic GUI generation
* A full set of trait types.  Most importantly, we don't provide container
  traits (list, dict, tuple) that can trigger notifications if their
  contents change.
* API compatibility with enthought.traits

There are also some important difference in our design:

* enthought.traits does not validate default values.  We do.

We choose to create this module because we need these capabilities, but
we need them to be pure Python so they work in all Python implementations,
including Jython and IronPython.

Inheritance diagram:

.. inheritance-diagram:: traitlets.traitlets
   :parts: 3
iN(   t	   ClassTypet   InstanceType(   t   warnt   warn_expliciti   (   t
   getargspec(   t   import_item(   t   Sentinel(   t   Buncht	   Undefinedt	   traitletssA   
Used in Traitlets to specify that no defaults are set in kwargs
t   Allsi   
Used in Traitlets to listen to all types of notification or to notifications
from all trait attributes.
t
   TraitErrorc           B   s   e  Z RS(    (   t   __name__t
   __module__(    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR   W   s   (   t   cast_unicode_py2s   [a-zA-Z_][a-zA-Z0-9_]*$c         C   s*   t  j r t t j |    S|  j   Sd  S(   N(   t   sixt   PY2t   boolt   _name_ret   matcht   isidentifier(   t   s(    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR   b   s    	c         C   sM   t  j j d  } | r( | d k r( t S|  t k rE t j |   t St Sd S(   sZ   Add our own checks for too many deprecation warnings.

    Limit to once per package.
    t   TRAITLETS_ALL_DEPRECATIONSt   0N(   t   ost   environt   gett   Truet   _deprecations_shownt   addt   False(   t   keyt   env_flag(    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   _should_warni   s    c         C   s  d j  d | j d | d |  } x0 t j |  D] } | | j k r1 | } Pq1 q1 W| j j d d  d } | | f } t |  s d Sy2 t j |   p d	 } t j	 |   d p d }	 Wn. t
 t f k
 r }
 t | d
 |
 t  n Xt | t | |	  d S(   s   Show deprecation warning about a magic method definition.

    Uses warn_explicit to bind warning to method definition instead of triggering code,
    which isn't relevant.
    s?   {classname}.{method_name} is deprecated in traitlets 4.1: {msg}t	   classnamet   method_namet   msgt   .i   i    Ns	   <unknown>s   
(inspection failed) %s(   t   formatR   t   inspectt   getmrot   __dict__R   t   splitR!   t   getsourcefilet   getsourcelinest   IOErrort	   TypeErrorR   t   DeprecationWarningR   (   t   methodt   clsR#   R$   t   warn_msgt   parentt   package_nameR   t   fnamet   linenot   e(    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   _deprecated_methodx   s     	c         C   s,   t  |  t j  r t |   St |  j j  S(   s    Returns a string containing the class name of an object with the
    correct indefinite article ('a' or 'an') preceding it (e.g., 'an Image',
    'a PlotValue').
    (   t
   isinstanceR   t   string_typest   add_articlet	   __class__R   (   t   object(    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   class_of   s    
c         C   s&   |  d  j    d k r d |  Sd |  S(   st    Returns a string containing the correct indefinite article ('a' or 'an')
    prefixed to the specified string.
    i   t   aeious   an s   a (   t   lower(   t   name(    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR;      s    c         C   sA   t  |   } t j r- | t k r- |  j } n  d |  | f } | S(   s]    Return a string representation of a value and its type for readable
    error messages.
    s   %r %r(   t   typeR   R   R   R<   (   t   objt   the_typeR$   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt	   repr_type   s
    c         C   s+   t  |  t  p* t  |  t  o* t |  t  S(   sN    Returns whether the given value is an instance or subclass of TraitType.
    (   R9   t	   TraitTypeRB   t
   issubclass(   t   t(    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   is_trait   s    c         C   s}   |  t  k s t |  t j  r% |  g S|  s8 t  |  k r? t  g Sx3 |  D]+ } t | t j  sF t d |   qF qF W|  Sd S(   s  Convert the name argument to a list of names.

    Examples
    --------

    >>> parse_notifier_name([])
    [All]
    >>> parse_notifier_name('a')
    ['a']
    >>> parse_notifier_name(['a', 'b'])
    ['a', 'b']
    >>> parse_notifier_name(All)
    [All]
    s   names must be strings, not %rN(   R
   R9   R   R:   R.   (   t   namest   n(    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   parse_notifier_name   s    t   _SimpleTestc           B   s,   e  Z d    Z d   Z d   Z d   Z RS(   c         C   s   | |  _  d  S(   N(   t   value(   t   selfRN   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   __init__   s    c         C   s   | |  j  k S(   N(   RN   (   RO   t   test(    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   __call__   s    c         C   s   d |  j  S(   Ns   <SimpleTest(%r)(   RN   (   RO   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   __repr__   s    c         C   s
   |  j    S(   N(   RS   (   RO   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   __str__   s    (   R   R   RP   RR   RS   RT   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRM      s   			c         C   s{   g  } xd t  |   D]V } y t |  |  } Wn t k
 r? q X| sS | |  r | j | | f  q q W| j   | S(   s  A safe version of inspect.getmembers that handles missing attributes.

    This is useful when there are descriptor based attributes that for
    some reason raise AttributeError even though they exist.  This happens
    in zope.inteface with the __provides__ attribute.
    (   t   dirt   getattrt   AttributeErrort   appendt   sort(   R=   t	   predicatet   resultsR   RN   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt
   getmembers   s    
c          G   s   x |  D] } t  |  d k s2 t d |   n  | \ } } t | t  sf t d t |    n  | | j   k r t d | | f   q q Wd S(   s.   Validate arguments for traitlet link functionsi   sK   Each linked traitlet must be specified as (HasTraits, 'trait_name'), not %rs%   Each object must be HasTraits, not %rs   %r has no trait %rN(   t   lenR.   R9   t	   HasTraitsRB   t   traits(   t   tuplesRH   RC   t
   trait_name(    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   _validate_link   s    t   linkc           B   sJ   e  Z d  Z e Z d   Z e j d    Z d   Z	 d   Z
 d   Z RS(   sC  Link traits from different objects together so they remain in sync.

    Parameters
    ----------
    source : (object / attribute name) pair
    target : (object / attribute name) pair

    Examples
    --------

    >>> c = link((src, 'value'), (tgt, 'value'))
    >>> src.value = 5  # updates other objects as well
    c         C   s   t  | |  | | |  _ |  _ z- t | d | d t | d | d   Wd  | d j |  j d | d | d j |  j d | d Xd  S(   Ni    i   RJ   (   Rb   t   sourcet   targett   setattrRV   t   observet   _update_targett   _update_source(   RO   Rd   Re   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRP     s    -c         c   s#   t  |  _ z	 d  VWd  t |  _ Xd  S(   N(   R   t   updatingR   (   RO   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   _busy_updating  s    		c         C   sE   |  j  r d  S|  j   & t |  j d |  j d | j  Wd  QXd  S(   Ni    i   (   Rj   Rk   Rf   Re   t   new(   RO   t   change(    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRh     s    	c         C   sE   |  j  r d  S|  j   & t |  j d |  j d | j  Wd  QXd  S(   Ni    i   (   Rj   Rk   Rf   Rd   Rl   (   RO   Rm   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRi   %  s    	c         C   s^   |  j  d j |  j d |  j  d |  j d j |  j d |  j d d \ |  _  |  _ d  S(   Ni    RJ   i   (   NN(   Rd   t	   unobserveRh   Re   Ri   t   None(   RO   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   unlink+  s    $$(   R   R   t   __doc__R   Rj   RP   t
   contextlibt   contextmanagerRk   Rh   Ri   Rp   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRc      s   				t   directional_linkc           B   sD   e  Z d  Z e Z d d  Z e j d    Z	 d   Z
 d   Z RS(   s  Link the trait of a source object with traits of target objects.

    Parameters
    ----------
    source : (object, attribute name) pair
    target : (object, attribute name) pair
    transform: callable (optional)
        Data transformation between source and target.

    Examples
    --------

    >>> c = directional_link((src, 'value'), (tgt, 'value'))
    >>> src.value = 5  # updates target objects
    >>> tgt.value = 6  # does not update source object
    c         C   s   | r | n d   |  _  t | |  | | |  _ |  _ z6 t | d | d |  j  t | d | d    Wd  |  j d j |  j d |  j d Xd  S(   Nc         S   s   |  S(   N(    (   t   x(    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   <lambda>E  s    i    i   RJ   (   t
   _transformRb   Rd   Re   Rf   RV   Rg   t   _update(   RO   Rd   Re   t	   transform(    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRP   D  s    %c         c   s#   t  |  _ z	 d  VWd  t |  _ Xd  S(   N(   R   Rj   R   (   RO   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRk   N  s    		c      	   C   sN   |  j  r d  S|  j   / t |  j d |  j d |  j | j   Wd  QXd  S(   Ni    i   (   Rj   Rk   Rf   Re   Rw   Rl   (   RO   Rm   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRx   V  s
    	c         C   s:   |  j  d j |  j d |  j  d d \ |  _  |  _ d  S(   Ni    RJ   i   (   NN(   Rd   Rn   Rx   Ro   Re   (   RO   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRp   ]  s    $N(   R   R   Rq   R   Rj   Ro   RP   Rr   Rs   Rk   Rx   Rp   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRt   1  s   
	t   BaseDescriptorc           B   s,   e  Z d  Z d Z d Z d   Z d   Z RS(   s  Base descriptor class

    Notes
    -----
    This implements Python's descriptor prototol.

    This class is the base class for all such descriptors.  The
    only magic we use is a custom metaclass for the main :class:`HasTraits`
    class that does the following:

    1. Sets the :attr:`name` attribute of every :class:`BaseDescriptor`
       instance in the class dict to the name of the attribute.
    2. Sets the :attr:`this_class` attribute of every :class:`BaseDescriptor`
       instance in the class dict to the *class* that declared the trait.
       This is used by the :class:`This` trait to allow subclasses to
       accept superclasses for :class:`This` values.
    c         C   s   | |  _  | |  _ d S(   sE  Part of the initialization which may depend on the underlying
        HasDescriptors class.

        It is typically overloaded for specific types.

        This method is called by :meth:`MetaHasDescriptors.__init__`
        passing the class (`cls`) and `name` under which the descriptor
        has been assigned.
        N(   t
   this_classRA   (   RO   R1   RA   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt
   class_init  s    
	c         C   s   d S(   sL  Part of the initialization which may depend on the underlying
        HasDescriptors instance.

        It is typically overloaded for specific types.

        This method is called by :meth:`HasTraits.__new__` and in the
        :meth:`BaseDescriptor.instance_init` method of descriptors holding
        other descriptors.
        N(    (   RO   RC   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   instance_init  s    
N(   R   R   Rq   Ro   RA   R{   R|   R}   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRz   i  s
   	RF   c           B   s   e  Z d  Z i  Z e Z e Z e Z d Z	 e e d d d d  Z d   Z d   Z d   Z d   Z d d  Z d d  Z d	   Z d
   Z d   Z d   Z d   Z d   Z d   Z d d  Z d   Z d   Z d   Z RS(   s&   A base class for all trait types.
    s	   any valuec         K   s  | t  k	 r | |  _ n  | r* | |  _ n  | d k	 rB | |  _ n  | d k	 rT | n d |  _ t |  d k rfd } t j   } x) | j	 j
 d k r | d 7} | j } q W| j j d  p d }	 |	 j d d  d }
 t d |
 g t |   } t |  r t d | f t d	 | n  t |  j  d k rZ|  j j   |  _ |  j j |  qx| |  _ n |  j j   |  _ | d k	 r| |  j d
 <n  | d k	 r| |  j d <n  d S(   s  Declare a traitlet.

        If *allow_none* is True, None is a valid value in addition to any
        values that are normally valid. The default is up to the subclass.
        For most trait types, the default value for ``allow_none`` is False.

        Extra metadata can be associated with the traitlet using the .tag() convenience method
        or by using the traitlet instance's .metadata dictionary.
        t    i    i   RP   R   R%   s   metadata-tags   metadata %s was set from the constructor. With traitlets 4.1, metadata should be set using the .tag() method, e.g., Int().tag(key1='value1', key2='value2')t
   stacklevelt   configt   helpN(   R   t   default_valuet
   allow_noneRo   t	   read_onlyR   R]   R'   t   currentframet   f_codet   co_namet   f_backt	   f_globalsR   R*   t   tuplet   sortedR!   R   R/   t   metadatat   copyt   update(   RO   R   R   R   R   R   t   kwargsR   t   ft   modt   pkgR   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRP     s:    
c         C   s   t  d t d d |  j S(   sn   DEPRECATED: Retrieve the static default value for this trait.

        Use self.default_value instead
        sR   get_default_value is deprecated in traitlets 4.0: use the .default_value attributeR   i   (   R   R/   R   (   RO   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   get_default_value  s    c         C   s<   t  d t d d |  j | |  j  } | | j |  j <| S(   sE   DEPRECATED: Set the static default value for the trait type.
        sS   init_default_value is deprecated in traitlets 4.0, and may be removed in the futureR   i   (   R   R/   t	   _validateR   t   _trait_valuesRA   (   RO   RC   RN   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   init_default_value  s
    c         C   s   |  j  r t |  j   } d |  j  } x | | j |  j  d  D]} } t | d  r | j j |  j   } | d k	 r | j | k r t	 j
 | j |  Sn  | | j k rC t | |  } | SqC Wn  t |  d d  S(   s  Retrieve a callable to calculate the default for this traitlet.

        This looks for:

        * default generators registered with the @default descriptor.
        * obj._{name}_default() on the class with the traitlet, or a subclass
          that obj belongs to.
        * trait.make_dynamic_default, which is defined by Instance

        If neither exist, it returns None
        s   _%s_defaulti   t   _trait_default_generatorst   make_dynamic_defaultN(   RA   RB   t   mrot   indexR{   t   hasattrR   R   Ro   t   typest
   MethodTypet   funcR)   RV   (   RO   RC   R   t	   meth_nameR1   t   default_handlerR0   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   _dynamic_default_callable  s    	!c         C   sr   | j  c |  j |  d  k rh |  j t k	 rh |  j | |  j  } |  j d  k	 rh | | j |  j <qh n  Wd  QXd  S(   N(   t   cross_validation_lockR   Ro   R   R   R   RA   R   (   RO   RC   t   v(    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR}     s    
c         C   s   y | j  |  j } Wn t k
 r |  j |  } | d  k r[ t d |  j | f   n  |  j | |    } | | j  |  j <| St k
 r t d   n X| Sd  S(   Ns)   No default value found for %s trait of %rs=   Unexpected error in TraitType: default value not set properly(   R   RA   t   KeyErrorR   Ro   R   R   t	   Exception(   RO   RC   R1   RN   t   dynamic_default(    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR     s    c         C   s$   | d k r |  S|  j | |  Sd S(   sM  Get the value of the trait by self.name for the instance.

        Default values are instantiated when :meth:`HasTraits.__new__`
        is called.  Thus by the time this method gets called either the
        default value or a user defined value (they called :meth:`__set__`)
        is in the :class:`HasTraits` instance.
        N(   Ro   R   (   RO   RC   R1   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   __get__!  s    c         C   s   |  j  | |  } y | j |  j } Wn t k
 rB |  j } n X| | j |  j <y t | | k  } Wn t } n X| t k	 r | j |  j | |  n  d  S(   N(	   R   R   RA   R   R   R   R   R   t   _notify_trait(   RO   RC   RN   t	   new_valuet	   old_valuet   silent(    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   set.  s    
c         C   s3   |  j  r t d |  j   n |  j | |  d S(   s   Set the value of the trait by self.name for the instance.

        Values pass through a validation stage where errors are raised when
        impropper types, or types that cannot be coerced, are encountered.
        s   The "%s" trait is read-only.N(   R   R   RA   R   (   RO   RC   RN   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   __set__@  s    	c         C   se   | d  k r |  j r | St |  d  r= |  j | |  } n  | j t k ra |  j | |  } n  | S(   Nt   validate(   Ro   R   R   R   t   _cross_validation_lockR   t   _cross_validate(   RO   RC   RN   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR   K  s    c         C   s   |  j  | j k rO t i |  d 6| d 6| d 6 } | j |  j  | |  } nZ t | d |  j   r d |  j  } t | |  } t | | j | d  | | |   } n  | S(   Nt   traitRN   t   owners   _%s_validates    use @validate decorator instead.(   RA   t   _trait_validatorsR   R   RV   R8   R<   (   RO   RC   RN   t   proposalR   t   cross_validate(    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR   T  s    !c         C   s7   t  | t  r# t |  g | j  St |  | g  Sd  S(   N(   R9   t   Uniont   trait_types(   RO   t   other(    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   __or__`  s    c         C   s   |  j  S(   N(   t	   info_text(   RO   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   infof  s    c         C   sl   | d  k	 r: d |  j t |  |  j   t |  f } n" d |  j |  j   t |  f } t |   d  S(   NsJ   The '%s' trait of %s instance must be %s, but a value of %s was specified.s;   The '%s' trait must be %s, but a value of %r was specified.(   Ro   RA   R>   R   RE   R   (   RO   RC   RN   R7   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   errori  s    c         C   sE   | d k r d } n d } t  d | t d d |  j j | |  S(   sn   DEPRECATED: Get a metadata value.

        Use .metadata[key] or .metadata.get(key, default) instead.
        R   s3   use the instance .help string directly, like x.helpsd   use the instance .metadata dictionary directly, like x.metadata[key] or x.metadata.get(key, default)s   Deprecated in traitlets 4.1, R   i   (   R   R/   R   R   (   RO   R   t   defaultR$   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   get_metadatas  s
    	c         C   sC   | d k r d } n d } t  d | t d d | |  j | <d S(   s[   DEPRECATED: Set a metadata key/value.

        Use .metadata[key] = value instead.
        R   s;   use the instance .help string directly, like x.help = valuesL   use the instance .metadata dictionary directly, like x.metadata[key] = values   Deprecated in traitlets 4.1, R   i   N(   R   R/   R   (   RO   R   RN   R$   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   set_metadata  s
    	c         K   s[   t  | j    j d d d d h  } | rG t d | t d d n  |  j j |  |  S(   s   Sets metadata and returns self.

        This allows convenient metadata tagging when initializing the trait, such as:

        >>> Int(0).tag(config=True, sync=True)
        R   R   R   R   sc   The following attributes are set in using `tag`, but seem to be constructor keywords arguments: %s R   i   (   R   t   keyst   intersectionR   t   UserWarningR   R   (   RO   R   t   maybe_constructor_keywords(    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   tag  s    'c         C   s   t  |  j  S(   N(   t   reprR   (   RO   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   default_value_repr  s    N(   R   R   Rq   R   R   R   R   R   R   R   Ro   RP   R   R   R   R}   R   R   R   R   R   R   R   R   R   R   R   R   R   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRF     s2   0						
								
		t   _CallbackWrapperc           B   s)   e  Z d  Z d   Z d   Z d   Z RS(   s   An object adapting a on_trait_change callback into an observe callback.

    The comparison operator __eq__ is implemented to enable removal of wrapped
    callbacks.
    c         C   si   | |  _  t |  j  t j  r$ d n d } t t |  d  | |  _ |  j d k re t d   n  d  S(   Nii    i   s1   a trait changed callback must have 0-4 arguments.(   t   cbR9   R   R   R]   R   t   nargsR   (   RO   R   t   offset(    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRP     s
    	!c         C   s0   t  | t  r |  j | j k S|  j | k Sd  S(   N(   R9   R   R   (   RO   R   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   __eq__  s    c         C   s   |  j  d k r |  j   n |  j  d k r> |  j | j  n |  j  d k rf |  j | j | j  nb |  j  d k r |  j | j | j | j  n4 |  j  d k r |  j | j | j | j | j  n  d  S(   Ni    i   i   i   i   (   R   R   RA   Rl   t   oldR   (   RO   Rm   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRR     s    (   R   R   Rq   RP   R   RR   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR     s   		c         C   s!   t  |  t  r |  St |   Sd  S(   N(   R9   R   (   R   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   _callback_wrapper  s    t   MetaHasDescriptorsc           B   s)   e  Z d  Z d   Z d   Z d   Z RS(   s   A metaclass for HasDescriptors.

    This metaclass makes sure that any TraitType class attributes are
    instantiated and sets their name attribute.
    c         C   s}   x[ | j    D]M \ } } t j |  r t | t  r t d t d d |   | | <q q Wt t |   j	 |  | | |  S(   s    Create the HasDescriptors class.s   Traits should be given as instances, not types (for example, `Int()`, not `Int`). Passing types is deprecated in traitlets 4.1.R   i   (
   t   itemsR'   t   isclassRG   RF   R   R/   t   superR   t   __new__(   t   mclsRA   t   basest	   classdictt   kR   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR     s    c         C   s-   t  t |   j | | |  |  j |  d S(   s-   Finish initializing the HasDescriptors class.N(   R   R   RP   t   setup_class(   R1   RA   R   R   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRP     s    c         C   sC   x< | j    D]. \ } } t | t  r | j |  |  q q Wd S(   s   Setup descriptor instance on the class

        This sets the :attr:`this_class` and :attr:`name` attributes of each
        BaseDescriptor in the class dict of the newly created ``cls`` before
        calling their :attr:`class_init` method.
        N(   R   R9   Rz   R|   (   R1   R   R   R   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR     s    (   R   R   Rq   R   RP   R   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR     s   		t   MetaHasTraitsc           B   s   e  Z d  Z d   Z RS(   s   A metaclass for HasTraits.c         C   s#   i  |  _  t t |   j |  d  S(   N(   R   R   R   R   (   R1   R   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR     s    	(   R   R   Rq   R   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR     s   c          O   st   |  s t  d   n  x@ |  D]8 } | t k	 r t | t j  r t  d |   q q Wt |  d | j d d  S(   s  A decorator which can be used to observe Traits on a class.

    The handler passed to the decorator will be called with one ``change``
    dict argument. The change dictionary at least holds a 'type' key and a
    'name' key, corresponding respectively to the type of notification and the
    name of the attribute that triggered the notification.

    Other keys may be passed depending on the value of 'type'. In the case
    where type is 'change', we also have the following keys:
    * ``owner`` : the HasTraits instance
    * ``old`` : the old value of the modified trait attribute
    * ``new`` : the new value of the modified trait attribute
    * ``name`` : the name of the modified trait attribute.

    Parameters
    ----------
    *names
        The str names of the Traits to observe on the object.
    type: str, kwarg-only
        The type of event to observe (e.g. 'change')
    s2   Please specify at least one trait name to observe.s5   trait names to observe must be strings or All, not %rRB   Rm   (   R.   R
   R9   R   R:   t   ObserveHandlerR   (   RJ   R   RA   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRg     s    c            s   t  t    f d  } | S(   sZ  Backward-compatibility shim decorator for observers

    Use with:

    @observe('name')
    @observe_compat
    def _foo_changed(self, change):
        ...

    With this, `super()._foo_changed(self, name, old, new)` in subclasses will still work.
    Allows adoption of new observer API without breaking subclasses that override and super.
    c            so   t  | t  r | } nJ |  j j } t d | | f t  t d d d | d | d | d |   }   |  |  S(   NsS   A parent of %s._%s_changed has adopted the new (traitlets 4.1) @observe(change) APIRB   Rm   R   Rl   RA   R   (   R9   t   dictR<   R   R   R/   R   (   RO   t   change_or_nameR   Rl   Rm   t   clsname(   R   (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   compatible_observer%  s    		(   R   (   R   R   (    (   R   s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   observe_compat  s    c          G   sb   |  s t  d   n  x@ |  D]8 } | t k	 r t | t j  r t  d |   q q Wt |   S(   s  A decorator to register cross validator of HasTraits object's state
    when a Trait is set.

    The handler passed to the decorator must have one ``proposal`` dict argument.
    The proposal dictionary must hold the following keys:
    * ``owner`` : the HasTraits instance
    * ``value`` : the proposed value for the modified trait attribute
    * ``trait`` : the TraitType instance associated with the attribute

    Parameters
    ----------
    names
        The str names of the Traits to validate.

    Notes
    -----
    Since the owner has access to the ``HasTraits`` instance via the 'owner' key,
    the registered cross validator could potentially make changes to attributes
    of the ``HasTraits`` instance. However, we recommend not to do so. The reason
    is that the cross-validation of attributes may run in arbitrary order when
    exiting the ``hold_trait_notifications`` context, and such changes may not
    commute.
    s3   Please specify at least one trait name to validate.s6   trait names to validate must be strings or All, not %r(   R.   R
   R9   R   R:   t   ValidateHandler(   RJ   RA   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR   7  s    c         C   s/   t  |  t j  s% t d |    n  t |   S(   s/   A decorator which assigns a dynamic default for a Trait on a HasTraits object.

    Parameters
    ----------
    name
        The str name of the Trait on the object whose default should be generated.

    Notes
    -----
    Unlike observers and validators which are properties of the HasTraits
    instance, default value generators are class-level properties.

    Besides, default generators are only invoked if they are registered in
    subclasses of `this_type`.

    ::

        class A(HasTraits):
            bar = Int()

            @default('bar')
            def get_bar_default(self):
                return 11


        class B(A):
            bar = Float()  # This trait ignores the default generator defined in
                           # the base class A


        class C(B):

            @default('bar')
            def some_other_default(self):  # This default generator should not be
                return 3.0                 # ignored since it is defined in a
                                           # class derived from B.a.this_class.
    s*   Trait name must be a string or All, not %r(   R9   R   R:   R.   t   DefaultHandler(   RA   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR   W  s    &t   EventHandlerc           B   s&   e  Z d    Z d   Z d d  Z RS(   c         C   s   | |  _  |  S(   N(   R   (   RO   R   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt
   _init_call  s    	c         O   s3   t  |  d  r |  j | |   S|  j | |   Sd S(   sC   Pass `*args` and `**kwargs` to the handler's function if it exists.R   N(   R   R   R   (   RO   t   argsR   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRR     s    c         C   s#   | d  k r |  St j |  j |  S(   N(   Ro   R   R   R   (   RO   t   instR1   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR     s    N(   R   R   R   RR   Ro   R   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR     s   		R   c           B   s   e  Z d    Z d   Z RS(   c         C   s   | |  _  | |  _ d  S(   N(   t   trait_namesRB   (   RO   RJ   RB   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRP     s    	c         C   s    | j  |  |  j d |  j d  S(   NRB   (   Rg   R   RB   (   RO   R   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR}     s    (   R   R   RP   R}   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR     s   	R   c           B   s   e  Z d    Z d   Z RS(   c         C   s   | |  _  d  S(   N(   R   (   RO   RJ   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRP     s    c         C   s   | j  |  |  j  d  S(   N(   t   _register_validatorR   (   RO   R   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR}     s    (   R   R   RP   R}   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR     s   	R   c           B   s   e  Z d    Z d   Z RS(   c         C   s   | |  _  d  S(   N(   Ra   (   RO   RA   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRP     s    c         C   s-   t  t |   j | |  |  | j |  j <d  S(   N(   R   R   R|   R   Ra   (   RO   R1   RA   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR|     s    (   R   R   RP   R|   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR     s   	t   HasDescriptorsc           B   s    e  Z d  Z d   Z d   Z RS(   s:   The base class for all classes that have descriptors.
    c         O   sV   t  t |   j } | t j k r0 | |   } n | |  | |  } | j | |   | S(   N(   R   R   R   R=   t   setup_instance(   R1   R   R   t   new_methR   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR     s    c         O   ss   t  |  _ |  j } xZ t |  D]L } y t | |  } Wn t k
 rK q Xt | t  r | j |   q q Wd S(   sD   
        This is called **before** self.__init__ is called.
        N(	   R   R   R<   RU   RV   RW   R9   Rz   R}   (   RO   R   R   R1   R   RN   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR     s    		(   R   R   Rq   R   R   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR     s   	R^   c           B   sF  e  Z d    Z d   Z d   Z d   Z e e j d     Z	 e j d    Z
 d   Z d   Z d   Z d	   Z d d e d
  Z e d d  Z e d d  Z e d  Z d   Z d   Z d   Z e d    Z e d    Z e d    Z d   Z d   Z d   Z d d  Z  e d    Z! e d d   Z" RS(   c         O   s8   i  |  _  i  |  _ i  |  _ t t |   j | |   d  S(   N(   R   t   _trait_notifiersR   R   R^   R   (   RO   R   R   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR     s    			c      	   O   s2  | } i  } |  j    N xF | j   D]8 \ } } |  j |  rT t |  | |  q& | | | <q& WWd  QXy t t |   j | |   Wn t k
 r-} g  | D] } t |  ^ q }	 x1 | j   D]# \ }
 } |	 j	 d |
 | f  q Wd j
 |	  } t d j d | d |  j j d |  t d d n Xd  S(	   Ns   %s=%rs   , s   Passing unrecoginized arguments to super({classname}).__init__({arg_s}).
{error}
This is deprecated in traitlets 4.2.This error will be raised in a future release of traitlets.t   arg_sR"   R   R   i   (   t   hold_trait_notificationsR   t	   has_traitRf   R   R^   RP   R.   R   RX   t   joinR   R&   R<   R   R/   (   RO   R   R   t
   super_argst   super_kwargsR   RN   R7   t   argt
   arg_s_listR   R   R   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRP     s(    	c         C   s'   |  j  j   } i  | d <i  | d <| S(   NR   R   (   R)   R   (   RO   t   d(    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   __getstate__  s    

c         C   sy   | j    |  _ |  j } xZ t |  D]L } y t | |  } Wn t k
 rQ q% Xt | t  r% | j |   q% q% Wd  S(   N(	   R   R)   R<   RU   RV   RW   R9   R   R}   (   RO   t   stateR1   R   RN   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   __setstate__  s    	c         c   s5   |  j  r d Vd Sz t |  _  d VWd t |  _  Xd S(   s   
        A contextmanager for running a block with our cross validation lock set
        to True.

        At the end of the block, the lock's value is restored to its value
        prior to entering the block.
        N(   R   R   R   (   RO   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR     s    
			c   	      #   s  |  j  r d Vd Si    |  j } d       f d   } z)yu | |  _ t |  _  d VxW t   j    D]C } t |  j |  } | j |  t |  |   } |  j | |  ql WWn t	 k
 rc} d   |  _ x   j
   D]q \ } } xb | d d d  D]M } | j d k r | j t k	 r9|  j | | j  qL|  j j |  q q Wq Wi    |  n XWd t |  _  |  ` x2   j   D]$ } x | D] } |  j |  qWqWXd S(   sH  Context manager for bundling trait change notifications and cross
        validation.

        Use this when doing multiple trait assignments (init, config), to avoid
        race conditions in trait notifiers requesting other trait values.
        All trait notifications will fire after all values have been assigned.
        Nc         S   s_   |  d k r | g S|  d d d k rJ | j d k rJ | j |  d d <n |  j |  |  Sd S(   s5   Merges the provided change with the last if possible.iRB   Rm   Rl   N(   Ro   RB   Rl   RX   (   t   past_changesRm   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   compress;  s    #c            s)   |  j  }    j |  |     | <d  S(   N(   RA   R   (   Rm   RA   (   t   cacheR   (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   holdG  s    	c         S   s   d  S(   N(   Ro   (   Ru   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRv   X  s    iRm   (   R   t   notify_changeR   t   listR   RV   R<   R   t	   set_traitR   R   RB   R   R   R   t   popR   t   values(	   RO   R   R   RA   R   RN   R7   t   changesRm   (    (   R   R   s2   lib/python2.7/site-packages/traitlets/traitlets.pyR   +  s>    				 			c         C   s2   |  j  t d | d | d | d |  d d   d  S(   NRA   R   Rl   R   RB   Rm   (   R   R   (   RO   RA   R   R   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR   m  s    c   	      C   s  t  | t  s t |  } n  | j | j } } g  } | j |  j j | i   j | g    | j |  j j | i   j t g    | j |  j j t i   j | g    | j |  j j t i   j t g    d | } t |  |  r^t	 |  j
 |  } t  | t  s^t | |  j
 | d  t	 |  |  } | | k r[| j t |   q[q^n  xf | D]^ } t  | t  r| j } n3 t  | t  r| j d  k	 rt	 |  | j  } n  | |  qeWd  S(   Ns   _%s_changeds$   use @observe and @unobserve instead.(   R9   R   RA   RB   t   extendR   R   R
   R   RV   R<   R   R8   RX   R   R   RR   R   Ro   (	   RO   Rm   RA   RB   t	   callablest
   magic_namet   class_valueR   t   c(    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR   v  s.    ((((
c         C   s   | |  j  k r, g  } i | | 6|  j  | <n> | |  j  | k rY g  } | |  j  | | <n |  j  | | } | | k r | j |  n  d  S(   N(   R   RX   (   RO   t   handlerRA   RB   t   nlist(    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   _add_notifiers  s    c         C   sQ   y9 | d  k r  |  j | | =n |  j | | j |  Wn t k
 rL n Xd  S(   N(   Ro   R   t   removeR   (   RO   R  RA   RB   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   _remove_notifiers  s    c         C   sg   t  d t d d | d k r( t } n  | rJ |  j t |  d | n |  j t |  d | d S(   s  DEPRECATED: Setup a handler to be called when a trait changes.

        This is used to setup dynamic notifications of trait changes.

        Static handlers can be created by creating methods on a HasTraits
        subclass with the naming convention '_[traitname]_changed'.  Thus,
        to create static handler for the trait 'a', create the method
        _a_changed(self, name, old, new) (fewer arguments can be used, see
        below).

        If `remove` is True and `handler` is not specified, all change
        handlers for the specified name are uninstalled.

        Parameters
        ----------
        handler : callable, None
            A callable that is called when a trait changes.  Its
            signature can be handler(), handler(name), handler(name, new),
            handler(name, old, new), or handler(name, old, new, self).
        name : list, str, None
            If None, the handler will apply to all traits.  If a list
            of str, handler will apply to all names in the list.  If a
            str, the handler will apply just to that name.
        remove : bool
            If False (the default), then install the handler.  If True
            then unintall it.
        sC   on_trait_change is deprecated in traitlets 4.1: use observe insteadR   i   RJ   N(   R   R/   Ro   R
   Rn   R   Rg   (   RO   R  RA   R	  (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   on_trait_change  s    	Rm   c         C   s4   t  |  } x! | D] } |  j | | |  q Wd S(   s	  Setup a handler to be called when a trait changes.

        This is used to setup dynamic notifications of trait changes.

        Parameters
        ----------
        handler : callable
            A callable that is called when a trait changes. Its
            signature should be ``handler(change)``, where ``change`` is a
            dictionary. The change dictionary at least holds a 'type' key.
            * ``type``: the type of notification.
            Other keys may be passed depending on the value of 'type'. In the
            case where type is 'change', we also have the following keys:
            * ``owner`` : the HasTraits instance
            * ``old`` : the old value of the modified trait attribute
            * ``new`` : the new value of the modified trait attribute
            * ``name`` : the name of the modified trait attribute.
        names : list, str, All
            If names is All, the handler will apply to all traits.  If a list
            of str, handler will apply to all names in the list.  If a
            str, the handler will apply just to that name.
        type : str, All (default: 'change')
            The type of notification to filter by. If equal to All, then all
            notifications are passed to the observe handler.
        N(   RL   R  (   RO   R  RJ   RB   RK   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRg     s    c         C   s4   t  |  } x! | D] } |  j | | |  q Wd S(   s  Remove a trait change handler.

        This is used to unregister handlers to trait change notifications.

        Parameters
        ----------
        handler : callable
            The callable called when a trait attribute changes.
        names : list, str, All (default: All)
            The names of the traits for which the specified handler should be
            uninstalled. If names is All, the specified handler is uninstalled
            from the list of notifiers corresponding to all changes.
        type : str or All (default: 'change')
            The type of notification to filter by. If All, the specified handler
            is uninstalled from the list of notifiers corresponding to all types.
        N(   RL   R
  (   RO   R  RJ   RB   RK   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRn     s    c         C   s>   | t  k r i  |  _ n" y |  j | =Wn t k
 r9 n Xd S(   s   Remove trait change handlers of any type for the specified name.
        If name is not specified, removes all trait notifiers.N(   R
   R   R   (   RO   RA   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   unobserve_all  s    c         C   s   xd | D]\ } d | } t  |  |  r t |  j |  } t | t  sc t | |  j | d  qc q q Wx | D] } | |  j | <qn Wd S(   s  Setup a handler to be called when a trait should be cross validated.

        This is used to setup dynamic notifications for cross-validation.

        If a validator is already registered for any of the provided names, a
        TraitError is raised and no new validator is registered.

        Parameters
        ----------
        handler : callable
            A callable that is called when the given trait is cross-validated.
            Its signature is handler(proposal), where proposal is a Bunch (dictionary with attribute access)
            with the following attributes/keys:
                * ``owner`` : the HasTraits instance
                * ``value`` : the proposed value for the modified trait attribute
                * ``trait`` : the TraitType instance associated with the attribute
        names : List of strings
            The names of the traits that should be cross-validated
        s   _%s_validates    use @validate decorator instead.N(   R   RV   R<   R9   R   R8   t   _HasTraits__classR   (   RO   R  RJ   RA   R  R  (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR     s    
c         K   sI   t  |  j j |  j f |  |  _ x! | j   D] } | j |   q. Wd S(   s;   Dynamically add trait attributes to the HasTraits instance.N(   RB   R<   R   R   R}   (   RO   R_   R   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt
   add_traits1  s    c         C   sQ   |  j  } |  j |  s4 t d | j | f   n t | |  j |  |  d S(   s>   Forcibly sets trait attribute, including read-only attributes.s'   Class %s does not have a trait named %sN(   R<   R   R   R   RV   R   (   RO   RA   RN   R1   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR   8  s
    	c         K   s   t  |  j |    S(   s   Get a list of all the names of this class' traits.

        This method is just like the :meth:`trait_names` method,
        but is unbound.
        (   R   t   class_traits(   R1   R   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   class_trait_namesA  s    c   	      K   s   t  g  t |   D] } t | d t  r | ^ q  } t |  d k rN | Si  } x | j   D]v \ } } xg | j   D]O \ } } t |  t j k	 r t	 |  } n  | | j
 j | d   sz Pqz qz W| | | <qa W| S(   s  Get a ``dict`` of all the traits of this class.  The dictionary
        is keyed on the name and the values are the TraitType objects.

        This method is just like the :meth:`traits` method, but is unbound.

        The TraitTypes returned don't know anything about the values
        that the various HasTrait's instances are holding.

        The metadata kwargs allow functions to be passed in which
        filter traits based on metadata values.  The functions should
        take a single value as an argument and return a boolean.  If
        any function returns False, then the trait is not included in
        the output.  If a metadata key doesn't exist, None will be passed
        to the function.
        i   i    N(   R   R\   R9   RF   R]   R   RB   R   t   FunctionTypeRM   R   R   Ro   (	   R1   R   t   membR_   t   resultRA   R   t	   meta_namet	   meta_eval(    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR  J  s    "c            s2   t  |  |       f d   |  j |   j   D S(   s   Get a dict of all the traitlets defined on this class, not a parent.

        Works like `class_traits`, except for excluding traits from parents.
        c            s7   i  |  ]- \ } } t    | d   | k	 r | |  q S(   N(   RV   Ro   (   t   .0RK   RH   (   t   sup(    s2   lib/python2.7/site-packages/traitlets/traitlets.pys
   <dictcomp>t  s   	 	(   R   R  R   (   R1   R   (    (   R  s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   class_own_traitsm  s    c         C   s   t  t |  j | d  t  S(   s?   Returns True if the object has a trait with the specified name.N(   R9   RV   R<   Ro   RF   (   RO   RA   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR   w  s    c         K   s   t  |  j |    S(   s2   Get a list of all the names of this class' traits.(   R   R_   (   RO   R   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR   {  s    c   	      K   s   t  g  t |  j  D] } t | d t  r | ^ q  } t |  d k rQ | Si  } x | j   D]v \ } } xg | j   D]O \ } } t |  t j	 k	 r t
 |  } n  | | j j | d   s} Pq} q} W| | | <qd W| S(   s  Get a ``dict`` of all the traits of this class.  The dictionary
        is keyed on the name and the values are the TraitType objects.

        The TraitTypes returned don't know anything about the values
        that the various HasTrait's instances are holding.

        The metadata kwargs allow functions to be passed in which
        filter traits based on metadata values.  The functions should
        take a single value as an argument and return a boolean.  If
        any function returns False, then the trait is not included in
        the output.  If a metadata key doesn't exist, None will be passed
        to the function.
        i   i    N(   R   R\   R<   R9   RF   R]   R   RB   R   R  RM   R   R   Ro   (	   RO   R   R  R_   R  RA   R   R  R  (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR_     s    "c         C   s   y t  |  j |  } Wn- t k
 rE t d |  j j | f   n Xd | d } t |  |  r | t  |  |  k r t  |  |  j | |  S| j j | |  Sd S(   s%   Get metadata values for trait by key.s'   Class %s does not have a trait named %st   _t	   _metadataN(   RV   R<   RW   R   R   R   R   R   (   RO   t	   traitnameR   R   R   t   metadata_name(    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   trait_metadata  s    $c            s2   t  |  |       f d   |  j |  j   D S(   s   Get a dict of all event handlers defined on this class, not a parent.

        Works like ``event_handlers``, except for excluding traits from parents.
        c            s7   i  |  ]- \ } } t    | d   | k	 r | |  q S(   N(   RV   Ro   (   R  RK   R7   (   R  (    s2   lib/python2.7/site-packages/traitlets/traitlets.pys
   <dictcomp>  s   	 	(   R   t   eventsR   (   R1   RA   (    (   R  s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   class_own_trait_events  s    c         C   s   i  } x t  |   D] \ } } t | t  r | d k rG | | | <q | | j k rc | | | <q t | d  r |  j | j   r | | | <q q q q W| S(   s  Get a ``dict`` of all the event handlers of this class.

        Parameters
        ----------
        name: str (default: None)
            The name of a trait of this class. If name is ``None`` then all
            the event handlers of this class will be returned instead.

        Returns
        -------
        The event handlers associated with a trait name, or all event handlers.
        t   tagsN(   R\   R9   R   Ro   R   R   R   (   R1   RA   R  R   R   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   trait_events  s    N(#   R   R   R   RP   R   R   t   propertyRr   Rs   R   R   R   R   R  R
  Ro   R   R  R
   Rg   Rn   R  R   R  R   t   classmethodR  R  R  R   R   R_   R  R  R!  (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR^     s8   		!			B			$			%					#
			 
t   ClassBasedTraitTypec           B   s    e  Z d  Z d   Z d   Z RS(   se   
    A trait with error reporting and string -> type resolution for Type,
    Instance and This.
    c         C   s
   t  |  S(   sM   
        Resolve a string supplied for a type into an actual object.
        (   R   (   RO   t   string(    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   _resolve_string  s    c         C   s   t  |  } t j r4 | t k r4 d | j j } n# d t |  d d !t |  f } | d  k	 r d |  j	 t
 |  |  j   | f } n d |  j	 |  j   | f } t |   d  S(   Ns   class %ss   %s (i.e. %s)i   isJ   The '%s' trait of %s instance must be %s, but a value of %s was specified.s;   The '%s' trait must be %s, but a value of %r was specified.(   RB   R   R   R   R<   R   t   strR   Ro   RA   R>   R   R   (   RO   RC   RN   t   kindR$   R7   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR     s    #(   R   R   Rq   R&  R   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR$    s   	t   Typec           B   sJ   e  Z d  Z e d d  Z d   Z d   Z d   Z d   Z	 d   Z
 RS(   s<   A trait whose value must be a subclass of a specified class.c         K   s   | t  k r' | d k r t n | } n | } | d k rc | d k sQ | t  k rZ t } qc | } n  t j |  p t | t j  s t d   n  | |  _	 t
 t |   j | |  d S(   s  Construct a Type trait

        A Type trait specifies that its values must be subclasses of
        a particular class.

        If only ``default_value`` is given, it is used for the ``klass`` as
        well. If neither are given, both default to ``object``.

        Parameters
        ----------
        default_value : class, str or None
            The default value must be a subclass of klass.  If an str,
            the str must be a fully specified class name, like 'foo.bar.Bah'.
            The string is resolved into real class, when the parent
            :class:`HasTraits` class is instantiated.
        klass : class, str [ default object ]
            Values of this trait must be a subclass of klass.  The klass
            may be specified in a string like: 'foo.bar.MyClass'.
            The string is resolved into real class, when the parent
            :class:`HasTraits` class is instantiated.
        allow_none : bool [ default False ]
            Indicates whether None is allowed as an assignable value.
        s"   A Type trait must specify a class.N(   R   Ro   R=   R'   R   R9   R   R:   R   t   klassR   R)  RP   (   RO   R   R*  R   t   new_default_value(    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRP     s    		!	c         C   s   t  | t j  rX y |  j |  } WqX t k
 rT t d |  j | | f   qX Xn  y t | |  j  rq | SWn n X|  j	 | |  d S(   s4   Validates that the value is a valid object instance.sJ   The '%s' trait of %s instance must be a type, but %r could not be importedN(
   R9   R   R:   R&  t   ImportErrorR   RA   RG   R*  R   (   RO   RC   RN   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR   $  s    c         C   sZ   t  |  j t j  r! |  j } n |  j j d |  j j } d | } |  j rV | d S| S(   s$    Returns a description of the trait.R%   s   a subclass of '%s's    or None(   R9   R*  R   R:   R   R   R   (   RO   R*  R  (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR   4  s    
	c         C   s$   |  j    t t |   j |  d  S(   N(   t   _resolve_classesR   R)  R}   (   RO   RC   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR}   ?  s    
c         C   s^   t  |  j t j  r- |  j |  j  |  _ n  t  |  j t j  rZ |  j |  j  |  _ n  d  S(   N(   R9   R*  R   R:   R&  R   (   RO   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR-  C  s    c         C   sE   |  j  } t | t j  r% t |  St d j | j | j   Sd  S(   Ns   {}.{}(   R   R9   R   R:   R   R&   R   R   (   RO   RN   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR   I  s    	
N(   R   R   Rq   R   Ro   RP   R   R   R}   R-  R   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR)    s   *				t   Instancec           B   s\   e  Z d  Z d Z d d d d  Z d   Z d   Z d   Z d   Z	 d   Z
 d   Z RS(	   s   A trait whose value must be an instance of a specified class.

    The value can also be an instance of a subclass of the specified class.

    Subclasses can declare default classes by overriding the klass attribute
    c         K   s   | d k r |  j } n  | d k	 rQ t j |  sE t | t j  rQ | |  _ n t d |   | d k	 r t | t  r t d   n  | d k	 r t | t	  r t d   n  | |  _
 | |  _ t t |   j |   d S(   sv  Construct an Instance trait.

        This trait allows values that are instances of a particular
        class or its subclasses.  Our implementation is quite different
        from that of enthough.traits as we don't allow instances to be used
        for klass and we handle the ``args`` and ``kw`` arguments differently.

        Parameters
        ----------
        klass : class, str
            The class that forms the basis for the trait.  Class names
            can also be specified as strings, like 'foo.bar.Bar'.
        args : tuple
            Positional arguments for generating the default value.
        kw : dict
            Keyword arguments for generating the default value.
        allow_none : bool [ default False ]
            Indicates whether None is allowed as a value.

        Notes
        -----
        If both ``args`` and ``kw`` are None, then the default value is None.
        If ``args`` is a tuple and ``kw`` is a dict, then the default is
        created as ``klass(*args, **kw)``.  If exactly one of ``args`` or ``kw`` is
        None, the None is replaced by ``()`` or ``{}``, respectively.
        s+   The klass attribute must be a class not: %rs)   The 'kw' argument must be a dict or None.s,   The 'args' argument must be a tuple or None.N(   Ro   R*  R'   R   R9   R   R:   R   R   R   t   default_argst   default_kwargsR   R.  RP   (   RO   R*  R   t   kwR   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRP   [  s    -
		c         C   s*   t  | |  j  r | S|  j | |  d  S(   N(   R9   R*  R   (   RO   RC   RN   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR     s    c         C   sN   t  |  j t j  r! |  j } n |  j j } t |  } |  j rJ | d S| S(   Ns    or None(   R9   R*  R   R:   R   R>   R   (   RO   R*  R  (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR     s    	c         C   s$   |  j    t t |   j |  d  S(   N(   R-  R   R.  R}   (   RO   RC   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR}     s    
c         C   s1   t  |  j t j  r- |  j |  j  |  _ n  d  S(   N(   R9   R*  R   R:   R&  (   RO   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR-    s    c         C   sD   |  j  d  k r" |  j d  k r" d  S|  j |  j  p4 d |  j p@ i    S(   N(    (   R/  Ro   R0  R*  (   RO   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR     s    c         C   s   t  |  j    S(   N(   R   R   (   RO   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR     s    N(   R   R   Rq   Ro   R*  RP   R   R   R}   R-  R   R   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR.  Q  s   .					t   ForwardDeclaredMixinc           B   s   e  Z d  Z d   Z RS(   sC   
    Mixin for forward-declared versions of Instance and Type.
    c         C   s%   |  j  j } t d j | | g   S(   s   
        Find the specified class name by looking for it in the module in which
        our this_class attribute was defined.
        R%   (   R{   R   R   R   (   RO   R%  t   modname(    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR&    s    (   R   R   Rq   R&  (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR2    s   t   ForwardDeclaredTypec           B   s   e  Z d  Z RS(   s+   
    Forward-declared version of Type.
    (   R   R   Rq   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR4    s   t   ForwardDeclaredInstancec           B   s   e  Z d  Z RS(   s/   
    Forward-declared version of Instance.
    (   R   R   Rq   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR5    s   t   Thisc           B   s&   e  Z d  Z d Z d   Z d   Z RS(   s  A trait for instances of the class containing this trait.

    Because how how and when class bodies are executed, the ``This``
    trait can only have a default value of None.  This, and because we
    always validate default values, ``allow_none`` is *always* true.
    s4   an instance of the same type as the receiver or Nonec         K   s   t  t |   j d  |  d  S(   N(   R   R6  RP   Ro   (   RO   R   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRP     s    c         C   s6   t  | |  j  s | d  k r" | S|  j | |  d  S(   N(   R9   R{   Ro   R   (   RO   RC   RN   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR     s    (   R   R   Rq   R   RP   R   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR6    s   	R   c           B   sD   e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z RS(   s'   A trait type representing a Union type.c         K   sQ   | |  _  d j g  |  j  D] } | j   ^ q  |  _ t t |   j |   d S(   s'  Construct a Union  trait.

        This trait allows values that are allowed by at least one of the
        specified trait types. A Union traitlet cannot have metadata on
        its own, besides the metadata of the listed types.

        Parameters
        ----------
        trait_types: sequence
            The list of trait types of length at least 1.

        Notes
        -----
        Union([Float(), Bool(), Int()]) attempts to validate the provided values
        with the validation function of Float, then Bool, and finally Int.
        s    or N(   R   R   R   R   R   R   RP   (   RO   R   R   t   tt(    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRP     s    	.c         C   sA   x! |  j  D] } | j | d   q
 Wt t |   j | |  d  S(   N(   R   R|   Ro   R   R   (   RO   R1   RA   t
   trait_type(    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR|     s    c         C   s;   x |  j  D] } | j |  q
 Wt t |   j |  d  S(   N(   R   R}   R   R   (   RO   RC   R8  (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR}     s    c      
   C   s   | j  z xr |  j D]g } yJ | j | |  } |  j d  k	 r_ t | d |  j d | j  n  | SWq t k
 rz q q Xq WWd  QX|  j | |  d  S(   NR  R  (	   R   R   R   RA   Ro   Rf   R   R   R   (   RO   RC   RN   R8  R   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR      s    
!c         C   s;   t  | t  r# t |  j | j  St |  j | g  Sd  S(   N(   R9   R   R   (   RO   R   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR     s    c         C   s]   |  j  t k	 r |  j  Sx@ |  j D]5 } | j  t k	 r< | j  St | d  r  | j   Sq  Wd  S(   NR   (   R   R   R   R   R   (   RO   R8  (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR     s    (	   R   R   Rq   RP   R|   R}   R   R   R   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR     s   					t   Anyc           B   s   e  Z d  Z d Z d Z RS(   s   A trait which allows any value.s	   any valueN(   R   R   Rq   Ro   R   R   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR9  "  s   c      
   C   s   |  j  d k	 rW | |  j  k  rW t d j d |  j d t |  d | d |  j     n  |  j d k	 r | |  j k r t d j d |  j d t |  d | d |  j    n  | S(	   s   
    Validate that a number to be applied to a trait is between bounds.

    If value is not between min_bound and max_bound, this raises a
    TraitError with an error message appropriate for this trait.
    s}   The value of the '{name}' trait of {klass} instance should not be less than {min_bound}, but a value of {value} was specifiedRA   R*  RN   t	   min_bounds   The value of the '{name}' trait of {klass} instance should not be greater than {max_bound}, but a value of {value} was specifiedt	   max_boundN(   t   minRo   R   R&   RA   R>   t   max(   R   RC   RN   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   _validate_bounds(  s    		t   Intc           B   s2   e  Z d  Z d Z d Z e e d  Z d   Z RS(   s   An int trait.i    s   an intc         K   sP   | j  d d   |  _ | j  d d   |  _ t t |   j d | d | |  d  S(   NR<  R=  R   R   (   R   Ro   R<  R=  R   R?  RP   (   RO   R   R   R   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRP   F  s    c         C   s2   t  | t  s" |  j | |  n  t |  | |  S(   N(   R9   t   intR   R>  (   RO   RC   RN   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR   L  s    (	   R   R   Rq   R   R   R   R   RP   R   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR?  @  s
   t   CIntc           B   s   e  Z d  Z d   Z RS(   s#   A casting version of the int trait.c         C   s:   y t  |  } Wn |  j | |  n Xt |  | |  S(   N(   R@  R   R>  (   RO   RC   RN   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR   U  s
    (   R   R   Rq   R   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRA  R  s   t   Longc           B   s;   e  Z d  Z d Z d Z e e d  Z d   Z d   Z	 RS(   s   A long integer trait.i    s   a longc         K   sP   | j  d d   |  _ | j  d d   |  _ t t |   j d | d | |  d  S(   NR<  R=  R   R   (   R   Ro   R<  R=  R   RB  RP   (   RO   R   R   R   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRP   d  s
    c         C   s@   t  | t  r | St  | t  r, t |  S|  j | |  d  S(   N(   R9   t   longR@  R   (   RO   RC   RN   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   _validate_longk  s
    
c         C   s"   |  j  | |  } t |  | |  S(   N(   RD  R>  (   RO   RC   RN   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR   r  s    (
   R   R   Rq   R   R   R   R   RP   RD  R   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRB  ^  s   	t   CLongc           B   s   e  Z d  Z d   Z RS(   s,   A casting version of the long integer trait.c         C   s:   y t  |  } Wn |  j | |  n Xt |  | |  S(   N(   RC  R   R>  (   RO   RC   RN   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR   z  s
    (   R   R   Rq   R   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRE  w  s   t   Integerc           B   s;   e  Z d  Z d Z d Z e e d  Z d   Z d   Z	 RS(   sW   An integer trait.

        Longs that are unnecessary (<= sys.maxint) are cast to ints.i    s
   an integerc         K   sP   | j  d d   |  _ | j  d d   |  _ t t |   j d | d | |  d  S(   NR<  R=  R   R   (   R   Ro   R<  R=  R   RF  RP   (   RO   R   R   R   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRP     s
    c         C   s{   t  | t  r | St  | t  r, t |  St j d k rg d d l m } t  | |  rg t |  Sn  |  j | |  d  S(   Nt   clii(   t   Int64(   R9   R@  RC  t   syst   platformt   SystemRH  R   (   RO   RC   RN   RH  (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   _validate_int  s    
c         C   s"   |  j  | |  } t |  | |  S(   N(   RL  R>  (   RO   RC   RN   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR     s    (
   R   R   Rq   R   R   R   R   RP   RL  R   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRF    s   	t   Floatc           B   s2   e  Z d  Z d Z d Z e e d  Z d   Z RS(   s   A float trait.g        s   a floatc         K   s]   | j  d t d   |  _ | j  d t d   |  _ t t |   j d | d | |  d  S(   NR<  t   infR=  R   R   (   R   t   floatR<  R=  R   RM  RP   (   RO   R   R   R   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRP     s    c         C   sP   t  | t  r t |  } n  t  | t  s@ |  j | |  n  t |  | |  S(   N(   R9   R@  RO  R   R>  (   RO   RC   RN   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR     s
    (	   R   R   Rq   R   R   R   R   RP   R   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRM    s
   t   CFloatc           B   s   e  Z d  Z d   Z RS(   s%   A casting version of the float trait.c         C   s:   y t  |  } Wn |  j | |  n Xt |  | |  S(   N(   RO  R   R>  (   RO   RC   RN   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR     s
    (   R   R   Rq   R   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRP    s   t   Complexc           B   s#   e  Z d  Z d Z d Z d   Z RS(   s   A trait for complex numbers.g        y                s   a complex numberc         C   sF   t  | t  r | St  | t t f  r2 t |  S|  j | |  d  S(   N(   R9   t   complexRO  R@  R   (   RO   RC   RN   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR     s
    
y                (   R   R   Rq   R   R   R   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRQ    s   t   CComplexc           B   s   e  Z d  Z d   Z RS(   s.   A casting version of the complex number trait.c         C   s,   y t  |  SWn |  j | |  n Xd  S(   N(   RR  R   (   RO   RC   RN   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR     s    (   R   R   Rq   R   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRS    s   t   Bytesc           B   s#   e  Z d  Z d Z d Z d   Z RS(   s   A trait for byte strings.R~   s   a bytes objectc         C   s'   t  | t  r | S|  j | |  d  S(   N(   R9   t   bytesR   (   RO   RC   RN   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR     s    (   R   R   Rq   R   R   R   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRT    s   t   CBytesc           B   s   e  Z d  Z d   Z RS(   s+   A casting version of the byte string trait.c         C   s,   y t  |  SWn |  j | |  n Xd  S(   N(   RU  R   (   RO   RC   RN   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR     s    (   R   R   Rq   R   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRV    s   t   Unicodec           B   s#   e  Z d  Z d Z d Z d   Z RS(   s   A trait for unicode strings.u    s   a unicode stringc         C   s   t  | t j  r | St  | t  rz y | j d d  SWqz t k
 rv d } t | j | |  j t	 |     qz Xn  |  j
 | |  d  S(   Nt   asciit   stricts<   Could not decode {!r} for unicode trait '{}' of {} instance.(   R9   R   t	   text_typeRU  t   decodet   UnicodeDecodeErrorR   R&   RA   R>   R   (   RO   RC   RN   R$   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR     s    +(   R   R   Rq   R   R   R   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRW    s   t   CUnicodec           B   s   e  Z d  Z d   Z RS(   s'   A casting version of the unicode trait.c         C   s/   y t  j |  SWn |  j | |  n Xd  S(   N(   R   RZ  R   (   RO   RC   RN   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR     s    (   R   R   Rq   R   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR]  	  s   t
   ObjectNamec           B   sA   e  Z d  Z d Z e j r' d   Z n e d    Z d   Z RS(   s{   A string holding a valid object name in this version of Python.

    This does not check that the name exists in any scope.s#   a valid object identifier in Pythonc         C   sH   t  | t  rD y t |  SWqD t k
 r@ |  j | |  qD Xn  | S(   s-   In Python 2, coerce ascii-only unicode to str(   R9   t   unicodeR'  t   UnicodeEncodeErrorR   (   RO   RC   RN   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt
   coerce_str  s    c         C   s   | S(   N(    (   R  R   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRv   $  s    c         C   sH   |  j  | |  } t | t j  r4 t |  r4 | S|  j | |  d  S(   N(   Ra  R9   R   R:   R   R   (   RO   RC   RN   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR   &  s    (	   R   R   Rq   R   R   R   Ra  t   staticmethodR   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR^    s   		t   DottedObjectNamec           B   s   e  Z d  Z d   Z RS(   sF   A string holding a valid dotted object name in Python, such as A.b3._cc         C   s[   |  j  | |  } t | t j  rG t d   | j d  D  rG | S|  j | |  d  S(   Nc         s   s   |  ] } t  |  Vq d  S(   N(   R   (   R  t   a(    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pys	   <genexpr>2  s   R%   (   Ra  R9   R   R:   t   allR*   R   (   RO   RC   RN   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR   /  s
    (   R   R   Rq   R   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRc  -  s   t   Boolc           B   s#   e  Z d  Z e Z d Z d   Z RS(   s   A boolean (True, False) trait.s	   a booleanc         C   s'   t  | t  r | S|  j | |  d  S(   N(   R9   R   R   (   RO   RC   RN   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR   >  s    (   R   R   Rq   R   R   R   R   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRf  8  s   t   CBoolc           B   s   e  Z d  Z d   Z RS(   s'   A casting version of the boolean trait.c         C   s,   y t  |  SWn |  j | |  n Xd  S(   N(   R   R   (   RO   RC   RN   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR   G  s    (   R   R   Rq   R   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRg  D  s   t   Enumc           B   s,   e  Z d  Z e d  Z d   Z d   Z RS(   s0   An enum whose value must be in a given sequence.c         K   sM   | |  _  | j d t  r0 | t k r0 d  } n  t t |   j | |  d  S(   NR   (   R   R   R   R   Ro   R   Rh  RP   (   RO   R   R   R   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRP   Q  s    		c         C   s'   | |  j  k r | S|  j | |  d  S(   N(   R   R   (   RO   RC   RN   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR   W  s    c         C   s(   d t  |  j  } |  j r$ | d S| S(   s$    Returns a description of the trait.s   any of s    or None(   R   R   R   (   RO   R  (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR   \  s    	(   R   R   Rq   R   RP   R   R   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRh  N  s   	t   CaselessStrEnumc           B   s#   e  Z d  Z e d  Z d   Z RS(   s4   An enum of strings where the case should be ignored.c         K   sB   g  | D] } t  |  ^ q } t t |   j | d | | d  S(   NR   (   R   R   Ri  RP   (   RO   R   R   R   RN   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRP   f  s    c         C   s   t  | t  r t |  } n  t  | t j  sC |  j | |  n  x- |  j D]" } | j   | j   k rM | SqM W|  j | |  d  S(   N(   R9   R'  R   R   R:   R   R   R@   (   RO   RC   RN   R   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR   j  s    (   R   R   Rq   R   RP   R   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRi  c  s   t	   Containerc           B   sb   e  Z d  Z d Z d Z e Z d Z d d d  Z	 d   Z
 d   Z d   Z d   Z d   Z RS(	   s\   An instance of a container (list, set, etc.)

    To be subclassed by overriding klass.
    c         K   s  | d k r( t |  r( | } d } n  | d k r= d	 } n: t | |  j  r[ | f } n t d |  j j | f   t |  r t | t  r t d t	 d d n  t | t  r |   n | |  _
 n% | d k	 r t d t |    n  t t |   j d |  j d | |  d S(
   s  Create a container trait type from a list, set, or tuple.

        The default value is created by doing ``List(default_value)``,
        which creates a copy of the ``default_value``.

        ``trait`` can be specified, which restricts the type of elements
        in the container to that TraitType.

        If only one arg is given and it is not a Trait, it is taken as
        ``default_value``:

        ``c = List([1, 2, 3])``

        Parameters
        ----------

        trait : TraitType [ optional ]
            the type for restricting the contents of the Container.  If unspecified,
            types are not checked.

        default_value : SequenceType [ optional ]
            The default value for the Trait.  Must be list/tuple/set, and
            will be cast to the container type.

        allow_none : bool [ default False ]
            Whether to allow the value to be None

        **kwargs : any
            further keys for extensions to the Trait (e.g. config)

        s   default value of %s was %ss   Traits should be given as instances, not types (for example, `Int()`, not `Int`). Passing types is deprecated in traitlets 4.1.R   i   s'   `trait` must be a Trait or None, got %sR*  R   N(    (   Ro   RI   R9   t   _valid_defaultsR.   R<   R   RB   R   R/   t   _traitRE   R   Rj  RP   R*  (   RO   R   R   R   R   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRP     s     !		$c         C   s;   d |  j  t |  | j   t |  f } t |   d  S(   NsU   Element of the '%s' trait of %s instance must be %s, but a value of %s was specified.(   RA   R>   R   RE   R   (   RO   RC   t   elementt	   validatorR7   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   element_error  s    (c         C   se   t  | |  j  r$ |  j |  } n  t t |   j | |  } | d  k rO | S|  j | |  } | S(   N(   R9   t   _cast_typesR*  R   Rj  R   Ro   t   validate_elements(   RO   RC   RN   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR     s    c         C   s   g  } |  j  d  k s' t |  j  t  r+ | Sx^ | D]V } y |  j  j | |  } Wn' t k
 rz |  j | | |  j   q2 X| j |  q2 W|  j |  S(   N(	   Rl  Ro   R9   R9  R   R   Ro  RX   R*  (   RO   RC   RN   t	   validatedR   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRq    s    !c         C   sE   t  |  j t  r( |  j j | d   n  t t |   j | |  d  S(   N(   R9   Rl  RF   R|   Ro   R   Rj  (   RO   R1   RA   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR|     s    c         C   s?   t  |  j t  r% |  j j |  n  t t |   j |  d  S(   N(   R9   Rl  RF   R}   R   Rj  (   RO   RC   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR}     s    N(    (   R   R   Rq   Ro   R*  Rp  t   SequenceTypesRk  Rl  RP   Ro  R   Rq  R|   R}   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRj  u  s   7				t   Listc           B   sP   e  Z d  Z e Z e f Z d d d e j	 d  Z
 d   Z d   Z d   Z RS(   s   An instance of a Python list.i    c         K   s8   | |  _  | |  _ t t |   j d | d | |  d S(   s  Create a List trait type from a list, set, or tuple.

        The default value is created by doing ``list(default_value)``,
        which creates a copy of the ``default_value``.

        ``trait`` can be specified, which restricts the type of elements
        in the container to that TraitType.

        If only one arg is given and it is not a Trait, it is taken as
        ``default_value``:

        ``c = List([1, 2, 3])``

        Parameters
        ----------

        trait : TraitType [ optional ]
            the type for restricting the contents of the Container.
            If unspecified, types are not checked.

        default_value : SequenceType [ optional ]
            The default value for the Trait.  Must be list/tuple/set, and
            will be cast to the container type.

        minlen : Int [ default 0 ]
            The minimum length of the input list

        maxlen : Int [ default sys.maxsize ]
            The maximum length of the input list
        R   R   N(   t   _minlent   _maxlenR   Rt  RP   (   RO   R   R   t   minlent   maxlenR   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRP     s    		c         C   s8   d |  j  t |  |  j |  j | f } t |   d  S(   Ns_   The '%s' trait of %s instance must be of length %i <= L <= %i, but a value of %s was specified.(   RA   R>   Ru  Rv  R   (   RO   RC   RN   R7   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   length_error	  s    %c         C   sV   t  |  } | |  j k  s* | |  j k r= |  j | |  n  t t |   j | |  S(   N(   R]   Ru  Rv  Ry  R   Rt  Rq  (   RO   RC   RN   t   length(    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRq  	  s    c         C   s1   t  t |   j | |  } |  j | |  } | S(   N(   R   Rt  R   Rq  (   RO   RC   RN   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR   	  s    N(   R   R   Rq   R   R*  R   Rp  Ro   RI  t   maxsizeRP   Ry  Rq  R   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRt    s   	$		t   Setc           B   s8   e  Z d  Z e Z e e f Z d d d e	 j
 d  Z RS(   s   An instance of a Python set.i    c         K   s&   t  t |   j | | | | |  d S(   s  Create a Set trait type from a list, set, or tuple.

        The default value is created by doing ``set(default_value)``,
        which creates a copy of the ``default_value``.

        ``trait`` can be specified, which restricts the type of elements
        in the container to that TraitType.

        If only one arg is given and it is not a Trait, it is taken as
        ``default_value``:

        ``c = Set({1, 2, 3})``

        Parameters
        ----------

        trait : TraitType [ optional ]
            the type for restricting the contents of the Container.
            If unspecified, types are not checked.

        default_value : SequenceType [ optional ]
            The default value for the Trait.  Must be list/tuple/set, and
            will be cast to the container type.

        minlen : Int [ default 0 ]
            The minimum length of the input list

        maxlen : Int [ default sys.maxsize ]
            The maximum length of the input list
        N(   R   R|  RP   (   RO   R   R   Rw  Rx  R   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRP   	  s     N(   R   R   Rq   R   R*  R   R   Rp  Ro   RI  R{  RP   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR|  	  s   t   Tuplec           B   sA   e  Z d  Z e Z e f Z d   Z d   Z d   Z	 d   Z
 RS(   s   An instance of a Python tuple.c         O   sW  | j  d t  } t |  d k rT | t k rT t | d  rT | d } d } n  | t k ri d } n: t | |  j  r | f } n t d |  j j | f   g  |  _	 xa | D]Y } t | t
  r t d t d d n  t | t
  r |   n | } |  j	 j |  q W|  j	 r.| d
 k r.d
 } n  t t |   j d |  j d	 | |  d
 S(   s  Create a tuple from a list, set, or tuple.

        Create a fixed-type tuple with Traits:

        ``t = Tuple(Int(), Str(), CStr())``

        would be length 3, with Int,Str,CStr for each element.

        If only one arg is given and it is not a Trait, it is taken as
        default_value:

        ``t = Tuple((1, 2, 3))``

        Otherwise, ``default_value`` *must* be specified by keyword.

        Parameters
        ----------

        `*traits` : TraitTypes [ optional ]
            the types for restricting the contents of the Tuple.  If unspecified,
            types are not checked. If specified, then each positional argument
            corresponds to an element of the tuple.  Tuples defined with traits
            are of fixed length.

        default_value : SequenceType [ optional ]
            The default value for the Tuple.  Must be list/tuple/set, and
            will be cast to a tuple. If ``traits`` are specified,
            ``default_value`` must conform to the shape and type they specify.
        R   i   i    s   default value of %s was %ss~   Traits should be given as instances, not types (for example, `Int()`, not `Int`) Passing types is deprecated in traitlets 4.1.R   i   R*  R   N(    (    (   R   R   R]   RI   R9   Rk  R.   R<   R   t   _traitsRB   R   R/   RX   Ro   R   Rj  RP   R*  (   RO   R_   R   R   R   R   RH   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRP   G	  s&    /
				c         C   s   |  j  s | St |  t |  j   k re d |  j t |  t |  j   t |  f } t |   n  g  } xj t |  j  |  D]V \ } } y | j | |  } Wn$ t k
 r |  j | | |  q~ X| j	 |  q~ Wt
 |  S(   NsT   The '%s' trait of %s instance requires %i elements, but a value of %s was specified.(   R~  R]   RA   R>   RE   R   t   zipR   Ro  RX   R   (   RO   RC   RN   R7   Rr  RH   R   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRq  	  s    	+c         C   sS   x3 |  j  D]( } t | t  r
 | j | d   q
 q
 Wt t |   j | |  d  S(   N(   R~  R9   RF   R|   Ro   R   Rj  (   RO   R1   RA   R   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR|   	  s    c         C   sM   x0 |  j  D]% } t | t  r
 | j |  q
 q
 Wt t |   j |  d  S(   N(   R~  R9   RF   R}   R   Rj  (   RO   RC   R   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR}   	  s    (   R   R   Rq   R   R*  R   Rp  RP   Rq  R|   R}   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR}  B	  s   		9		t   Dictc           B   sS   e  Z d  Z d Z d d e d  Z d   Z d   Z d   Z	 d   Z
 d   Z RS(   s   An instance of a Python dict.c         K   sO  | t  k r6 | d k	 r6 t |  s6 | } d } q6 n  | t  k rK i  } n  | d k r` d } nF t | t  r{ | f } n+ t | t  r | f } n t d |   t |  r t | t  r t d t	 d d n  t | t  r |   n | |  _
 n% | d k	 r t d t |    n  | |  _ t t |   j d t d | |  d S(	   s  Create a dict trait type from a Python dict.

        The default value is created by doing ``dict(default_value)``,
        which creates a copy of the ``default_value``.

        Parameters
        ----------

        trait : TraitType [ optional ]
            The specified trait type to check and use to restrict contents of
            the Container. If unspecified, trait types are not checked.

        traits : Dictionary of trait types [ optional ]
            A Python dictionary containing the types that are valid for
            restricting the content of the Dict Container for certain keys.

        default_value : SequenceType [ optional ]
            The default value for the Dict.  Must be dict, tuple, or None, and
            will be cast to a dict if not None. If `trait` is specified, the
            `default_value` must conform to the constraints it specifies.
        s   default value of Dict was %ss~   Traits should be given as instances, not types (for example, `Int()`, not `Int`) Passing types is deprecated in traitlets 4.1.R   i   s'   `trait` must be a Trait or None, got %sR*  R   N(   R   Ro   RI   R9   R   Rs  R.   RB   R   R/   Rl  RE   R~  R   R  RP   (   RO   R   R_   R   R   R   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRP   	  s,    		$	c         C   s;   d |  j  t |  | j   t |  f } t |   d  S(   NsU   Element of the '%s' trait of %s instance must be %s, but a value of %s was specified.(   RA   R>   R   RE   R   (   RO   RC   Rm  Rn  R7   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRo  	  s    (c         C   sA   t  t |   j | |  } | d  k r+ | S|  j | |  } | S(   N(   R   R  R   Ro   Rq  (   RO   RC   RN   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR   	  s
    c   	      C   s   t  |  j  } |  j p t   } | r; t | t  r; | Si  } x | D] } | rs | |  j k rs |  j | } n | } y2 | | } t | t  s | j | |  } n  Wn$ t k
 r |  j | | |  qH X| | | <qH W|  j |  S(   N(	   R   R~  Rl  R9  R9   R   R   Ro  R*  (	   RO   RC   RN   t   use_dictt
   default_toRr  R   t   validate_withR   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRq  	  s"    
c         C   s   t  |  j t  r( |  j j | d   n  |  j d  k	 rd x* |  j j   D] } | j | d   qG Wn  t t |   j | |  d  S(   N(	   R9   Rl  RF   R|   Ro   R~  R   R   R  (   RO   R1   RA   R   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR|   	  s    c         C   sx   t  |  j t  r% |  j j |  n  |  j d  k	 r^ x' |  j j   D] } | j |  qD Wn  t t |   j |  d  S(   N(	   R9   Rl  RF   R}   R~  Ro   R   R   R  (   RO   RC   R   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR}   
  s    N(   R   R   Rq   Ro   Rl  R   RP   Ro  R   Rq  R|   R}   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR  	  s   7				t
   TCPAddressc           B   s#   e  Z d  Z d Z d Z d   Z RS(   sg   A trait for an (ip, port) tuple.

    This allows for both IPv4 IP addresses as well as hostnames.
    s	   127.0.0.1i    s   an (ip, port) tuplec         C   s   t  | t  ry t |  d k ry t  | d t j  rv t  | d t  rv | d } | d k rs | d k rs | Sqv qy n  |  j | |  d  S(   Ni   i    i   i  (   R9   R   R]   R   R:   R@  R   (   RO   RC   RN   t   port(    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR   
  s    )
(   s	   127.0.0.1i    (   R   R   Rq   R   R   R   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR  
  s   t   CRegExpc           B   s   e  Z d  Z d Z d   Z RS(   s   A casting compiled regular expression trait.

    Accepts both strings and compiled regular expressions. The resulting
    attribute will be a compiled regular expression.s   a regular expressionc         C   s/   y t  j |  SWn |  j | |  n Xd  S(   N(   t   ret   compileR   (   RO   RC   RN   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR   )
  s    (   R   R   Rq   R   R   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR  !
  s   t   UseEnumc           B   sP   e  Z d  Z d Z d Z d d  Z e d  Z e d  Z	 d   Z
 d   Z RS(   s  Use a Enum class as model for the data type description.
    Note that if no default-value is provided, the first enum-value is used
    as default-value.

    .. sourcecode:: python

        # -- SINCE: Python 3.4 (or install backport: pip install enum34)
        import enum
        from traitlets import HasTraits, UseEnum

        class Color(enum.Enum):
            red = 1         # -- IMPLICIT: default_value
            blue = 2
            green = 3

        class MyEntity(HasTraits):
            color = UseEnum(Color, default_value=Color.blue)

        entity = MyEntity(color=Color.red)
        entity.color = Color.green    # USE: Enum-value (preferred)
        entity.color = "green"        # USE: name (as string)
        entity.color = "Color.green"  # USE: scoped-name (as string)
        entity.color = 3              # USE: number (as int)
        assert entity.color is Color.green
    s"   Trait type adapter to a Enum classc         K   s   t  | t j  s" t d |   | j d t  } | d  k rc | rc t | j j	    d } n  t
 t |   j d | |  | |  _ | j d |  _ d  S(   Ns   REQUIRE: enum.Enum, but was: %rR   i    R   R%   (   RG   t   enumRh  t   AssertionErrorR   R   Ro   R   t   __members__R   R   R  RP   t
   enum_classR   t   name_prefix(   RO   R  R   R   R   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyRP   M
  s    	c         C   sO   t  | t  s t  |  j j } x' | j   D] } | j | k r. | Sq. W| S(   s0   Selects enum-value by using its number-constant.(   R9   R@  R  R  R  R   RN   (   RO   RN   R   t   enum_memberst	   enum_item(    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   select_by_numberW
  s    c         C   s[   t  | t j  s t  | j |  j  rE | j |  j d d  } n  |  j j j	 | |  S(   s4   Selects enum-value by using its name or scoped-name.R~   i   (
   R9   R   R:   R  t
   startswithR  t   replaceR  R  R   (   RO   RN   R   (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   select_by_namea
  s    c         C   s   t  | |  j  r | St  | t  rG |  j |  } | t k	 r | SnW t  | t j  r{ |  j |  } | t k	 r | Sn# | d  k r |  j	 r d  S|  j
 Sn  |  j | |  d  S(   N(   R9   R  R@  R  R   R   R:   R  Ro   R   R   R   (   RO   RC   RN   t   value2(    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR   i
  s    	
c         C   s4   d d j  |  j j j    } |  j r0 | d S| S(   s=   Returns a description of this Enum trait (in case of errors).s
   Any of: %ss   , s    or None(   R   R  R  R   R   (   RO   R  (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR   }
  s    	N(   R   R   Rq   Ro   R   R   RP   R   R  R  R   R   (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyR  0
  s   

	(n   Rq   Rr   R'   R   R  RI  R   R  R    R   RB   t
   ClassTypest   warningsR   R   R   t   utils.getargspecR   t   utils.importstringR   t   utils.sentinelR   t   utils.bunchR   R   R   R   t	   frozensetRs  R   R
   t   NoDefaultSpecifiedR   R   t   ipython_genutils.py3compatR   R  R   R   R   R!   R8   R>   R;   RE   RI   RL   RM   Ro   R\   Rb   R=   Rc   Rt   t   dlinkRz   RF   R   R   R   R   Rg   R   R   R   R   R   R   R   t   with_metaclassR   R^   R$  R)  R.  R2  R4  R5  R6  R   R9  R>  R?  RA  R   RB  RE  RF  RM  RP  RQ  RS  RT  RV  RW  R]  R^  Rc  Rf  Rg  Rh  Ri  Rj  Rt  R|  R}  R  R  R  R  (    (    (    s2   lib/python2.7/site-packages/traitlets/traitlets.pyt   <module>#   s   										
			
	300 	#	'			 	+
	
"""  Z[D		"


i;)^o