ó
ž›V]c           @   s  d  d l  m Z d  d l m Z d  d l Z d  d l Z d  d l Z d  d l m Z d  d l	 m
 Z
 m Z m Z m Z m Z d  d l m Z m Z m Z m Z m Z m Z m Z m Z m Z m Z d  d l m Z e d e f d	 „  ƒ  YZ i  Z e j ƒ  Z  dL d
 „ Z! i e" d 6e# d 6e d 6e$ d ƒ d 6e j& d 6e' d 6e d 6Z( e j) d e! e( ƒ ƒ Z* d „  Z+ d „  Z, d e$ f d „  ƒ  YZ- d „  Z. dM d d d e. d „ Z/ dN d d d „ Z0 e/ d e j1 d ƒ d i e j2 d 6e j3 d 6e j4 d 6e
 j5 d  6e
 j6 d! 6e j7 d" 6e j8 d# 6e
 j9 d$ 6e j: d% 6e
 j; d& 6e j< d' 6e j= d( 6e
 j> d) 6e j? d* 6e j@ d+ 6e
 jA d, 6e jB d- 6e jC d. 6e
 jD d/ 6e
 jE d0 6e jF d1 6d2 e jG d3 d d4 d5 „  ƒ ZH e/ d e j1 d6 ƒ d i e j2 d 6e j3 d 6e j4 d 6e jI d7 6e jJ d8 6e jK d  6e j8 d# 6e j: d% 6e
 j; d& 6e j< d' 6e j= d( 6e jL d9 6e
 j> d) 6e j? d* 6e j@ d+ 6e jM d: 6e
 jA d, 6e j7 d; 6e jN d< 6e jO d= 6e jB d- 6e jC d. 6e jP d/ 6e jQ d> 6e j$ d0 6e jF d1 6d2 e jR d3 d6 d4 d? „  ƒ ZS e/ d e j1 d@ ƒ d i e j2 d 6e j3 d 6e j4 d 6e jI d7 6e jJ d8 6e jT dA 6e jU dB 6e jK d  6e j8 d# 6e jV dC 6e jW dD 6e j: d% 6e jX d& 6e j< d' 6e j= d( 6e jL d9 6e jY d) 6e j? d* 6e j@ d+ 6e jM d: 6e jZ d, 6e j7 d; 6e jN d< 6e jO d= 6e jB d- 6e jC d. 6e jP d/ 6e j[ dE 6e jQ d> 6e j$ d0 6e jF d1 6d2 e j\ d3 d@ ƒ Z] e/ d e j1 dF ƒ d i  e j2 d 6e j3 d 6e j4 d 6e jI d7 6e jJ d8 6e jT dA 6e jU dB 6e jK d  6e j8 d# 6e jV dC 6e jW dD 6e j: d% 6e j^ dG 6e jX d& 6e j< d' 6e j= d( 6e jL d9 6e jY d) 6e j? d* 6e j@ d+ 6e jM d: 6e jZ d, 6e j7 d; 6e jO d= 6e jN d< 6e jB d- 6e jC d. 6e jP d/ 6e j[ dE 6e jQ d> 6e j$ d0 6e jF d1 6d2 e j_ d3 dF ƒ Z` e` Za dH eb f dI „  ƒ  YZc d dJ „ Zd ea dK „ Ze d S(O   iÿÿÿÿ(   t   division(   t   warnN(   t   add_metaclass(   t   _legacy_validatorst   _typest   _utilst   _validatorst
   exceptions(
   t   Sequencet	   int_typest	   iteritemst	   lru_cachet	   str_typest   unquotet	   urldefragt   urljoint   urlopent   urlsplit(   t	   ErrorTreet   _DontDoThatc           B   s   e  Z d  Z d „  Z RS(   sý   
    Raised when a Validators with non-default type checker is misused.

    Asking one for DEFAULT_TYPES doesn't make sense, since type checkers exist
    for the unrepresentable cases where DEFAULT_TYPES can't represent the type
    relationship.
    c         C   s   d S(   Ns=   DEFAULT_TYPES cannot be used on Validators using TypeCheckers(    (   t   self(    (    s4   lib/python2.7/site-packages/jsonschema/validators.pyt   __str__.   s    (   t   __name__t
   __module__t   __doc__R   (    (    (    s4   lib/python2.7/site-packages/jsonschema/validators.pyR   %   s   c         C   sL   t  |  ƒ }  d „  } i  } x* t |  ƒ D] \ } } | | ƒ | | <q( W| S(   s   
    Generate newer-style type checks out of JSON-type-name-to-type mappings.

    Arguments:

        types (dict):

            A mapping of type names to their Python types

    Returns:

        A dictionary of definitions to pass to `TypeChecker`
    c            s"   t  j ˆ  ƒ ‰  ‡  f d †  } | S(   Nc            s/   t  | t ƒ r" t ˆ  k r" t Sn  t  | ˆ  ƒ S(   N(   t
   isinstancet   boolt   False(   t   checkert   instance(   t   pytypes(    s4   lib/python2.7/site-packages/jsonschema/validators.pyt
   type_checkI   s    (   R   t   flatten(   R   R   (    (   R   s4   lib/python2.7/site-packages/jsonschema/validators.pyt   gen_type_checkF   s    (   t   dictR
   (   t   typesR!   t   definitionst   typenameR   (    (    s4   lib/python2.7/site-packages/jsonschema/validators.pyt   _generate_legacy_type_checks6   s    	u   arrayu   booleanu   integeru   nullu   numberu   objectu   stringt   type_checkersc            s   ‡  f d †  } | S(   s„  
    Register the decorated validator for a ``version`` of the specification.

    Registered validators and their meta schemas will be considered when
    parsing ``$schema`` properties' URIs.

    Arguments:

        version (str):

            An identifier to use as the version's name

    Returns:

        callable: a class decorator to decorate the validator with the version
    c            s3   |  t  ˆ  <|  j |  j ƒ } | r/ |  t | <n  |  S(   N(   t
   validatorst   ID_OFt   META_SCHEMAt   meta_schemas(   t   clst   meta_schema_id(   t   version(    s4   lib/python2.7/site-packages/jsonschema/validators.pyt
   _validatesx   s
    
(    (   R.   R/   (    (   R.   s4   lib/python2.7/site-packages/jsonschema/validators.pyt	   validatesf   s    c         C   s5   |  j  d  k r t ƒ  ‚ n  t d t d d ƒ|  j S(   Nsc   The DEFAULT_TYPES attribute is deprecated. See the type checker attached to this validator instead.t
   stackleveli   (   t   _CREATED_WITH_DEFAULT_TYPESt   NoneR   R   t   DeprecationWarningt   _DEFAULT_TYPES(   R   (    (    s4   lib/python2.7/site-packages/jsonschema/validators.pyR5      s    t!   _DefaultTypesDeprecatingMetaClassc           B   s   e  Z e e ƒ Z RS(    (   R   R   t   propertyR5   t   DEFAULT_TYPES(    (    (    s4   lib/python2.7/site-packages/jsonschema/validators.pyR6      s   c         C   s,   |  t  k s |  t k r d S|  j d d ƒ S(   Nu    u   $id(   t   TrueR   t   get(   t   schema(    (    s4   lib/python2.7/site-packages/jsonschema/validators.pyt   _id_of”   s    c      	      s  ˆ d
 k	 r[ ˆ d
 k	 r' t d ƒ ‚ n  t ‰  t d t d d ƒt j d t ˆ ƒ ƒ ‰ n< t ‰ ˆ d
 k r| t	 ‰  t
 ‰ n ˆ t
 k r‘ t	 ‰  n d
 ‰  t t ƒ d t f ‡  ‡ ‡ ‡ ‡ ‡ f d †  ƒ  Yƒ } | d
 k	 rt | ƒ | ƒ } | j ƒ  j d d	 ƒ d | _ n  | S(   s›  
    Create a new validator class.

    Arguments:

        meta_schema (collections.Mapping):

            the meta schema for the new validator class

        validators (collections.Mapping):

            a mapping from names to callables, where each callable will
            validate the schema property with the given name.

            Each callable should take 4 arguments:

                1. a validator instance,
                2. the value of the property being validated within the
                   instance
                3. the instance
                4. the schema

        version (str):

            an identifier for the version that this validator class will
            validate. If provided, the returned validator class will have its
            ``__name__`` set to include the version, and also will have
            `jsonschema.validators.validates` automatically called for the
            given version.

        type_checker (jsonschema.TypeChecker):

            a type checker, used when applying the :validator:`type` validator.

            If unprovided, a `jsonschema.TypeChecker` will be created with
            a set of default types typical of JSON Schema drafts.

        default_types (collections.Mapping):

            .. deprecated:: 3.0.0

                Please use the type_checker argument instead.

            If set, it provides mappings of JSON types to Python types that
            will be converted to functions and redefined in this object's
            `jsonschema.TypeChecker`.

        id_of (callable):

            A function that given a schema, returns its ID.

    Returns:

        a new `jsonschema.IValidator` class
    s;   Do not specify default_types when providing a type checker.sP   The default_types argument is deprecated. Use the type_checker argument instead.R1   i   R'   t	   Validatorc              s¶   e  Z e ˆ ƒ Z e ˆ ƒ Z ˆ Z e ˆ ƒ Z e e	 ƒ Z
 e ˆ ƒ Z	 ˆ  Z d d d ‡ f d  † Z e d „  ƒ Z d ‡ f d † Z d d d „ Z d „  Z d „  Z d d „ Z RS(	   c            sz   | r7 t  d t d d ƒ|  j j t | ƒ ƒ |  _ n  | d  k r[ t j | d ˆ  ƒ} n  | |  _ | |  _	 | |  _
 d  S(   Nsa   The types argument is deprecated. Provide a type_checker to jsonschema.validators.extend instead.R1   i   t   id_of(   R   R4   t   TYPE_CHECKERt   redefine_manyR&   R3   t   RefResolvert   from_schemat   resolvert   format_checkerR;   (   R   R;   R#   RC   RD   (   R>   (    s4   lib/python2.7/site-packages/jsonschema/validators.pyt   __init__  s    			c         S   s9   x2 |  |  j  ƒ j | ƒ D] } t j j | ƒ ‚ q Wd  S(   N(   R*   t   iter_errorsR   t   SchemaErrort   create_from(   R,   R;   t   error(    (    s4   lib/python2.7/site-packages/jsonschema/validators.pyt   check_schema  s    c         3   s’  | d  k r |  j } n  | t k r( d  S| t k re t j d | f d d  d d  d | d | ƒVd  Sˆ  | ƒ } | rŠ |  j j | ƒ n  zê | j d ƒ } | d  k	 rº d | f g } n t	 | ƒ } xª | D]¢ \ } } |  j
 j | ƒ } | d  k rý qÍ n  | |  | | | ƒ pd }	 xT |	 D]L }
 |
 j d | d | d | d | ƒ | d k rf|
 j j | ƒ n  |
 VqWqÍ WWd  | r|  j j ƒ  n  Xd  S(   Ns   False schema does not allow %rt	   validatort   validator_valueR   R;   u   $ref(    (   R3   R;   R9   R   R   t   ValidationErrorRC   t
   push_scopeR:   R
   t
   VALIDATORSt   _sett   schema_patht
   appendleftt	   pop_scope(   R   R   t   _schemat   scopet   refR(   t   kt   vRK   t   errorsRI   (   R>   (    s4   lib/python2.7/site-packages/jsonschema/validators.pyRF   #  sH    	c         s   sd   x] |  j  | | ƒ D]I } | d  k	 r8 | j j | ƒ n  | d  k	 rW | j j | ƒ n  | Vq Wd  S(   N(   RF   R3   t   pathRR   RQ   (   R   R   R;   RZ   RQ   RI   (    (    s4   lib/python2.7/site-packages/jsonschema/validators.pyt   descendR  s    c         _   s'   x  |  j  | | Ž  D] } | ‚ q Wd  S(   N(   RF   (   R   t   argst   kwargsRI   (    (    s4   lib/python2.7/site-packages/jsonschema/validators.pyt   validateZ  s    c         S   sJ   y |  j  j | | ƒ SWn, t j k
 rE t j | | |  j ƒ ‚ n Xd  S(   N(   R?   t   is_typeR   t   UndefinedTypeCheckt   UnknownTypeR;   (   R   R   t   type(    (    s4   lib/python2.7/site-packages/jsonschema/validators.pyR_   ^  s    c         S   s%   t  |  j | | ƒ d  ƒ } | d  k S(   N(   t   nextRF   R3   (   R   R   RT   RI   (    (    s4   lib/python2.7/site-packages/jsonschema/validators.pyt   is_validd  s    (    N(   R   R   R"   RO   R*   R?   t   staticmethodR)   R7   R5   R8   R2   R3   RE   t   classmethodRJ   RF   R[   R^   R_   Rd   (    (   t   _created_with_default_typest   default_typesR>   t   meta_schemat   type_checkerR(   (    s4   lib/python2.7/site-packages/jsonschema/validators.pyR=   õ   s    /		t    t    N(   R3   t	   TypeErrorR9   R   R4   R   t   TypeCheckerR&   t   _DEPRECATED_DEFAULT_TYPESR   t*   _TYPE_CHECKER_FOR_DEPRECATED_DEFAULT_TYPESR   R6   t   objectR0   t   titlet   replaceR   (   Ri   R(   R.   Rh   Rj   R>   R=   (    (   Rg   Rh   R>   Ri   Rj   R(   s4   lib/python2.7/site-packages/jsonschema/validators.pyt   createš   s0    @			+r"c         C   sw   t  |  j ƒ } | j | ƒ | d k r4 |  j } n |  j rL t d ƒ ‚ n  t d |  j d | d | d | d |  j	 ƒ S(   s¢  
    Create a new validator class by extending an existing one.

    Arguments:

        validator (jsonschema.IValidator):

            an existing validator class

        validators (collections.Mapping):

            a mapping of new validator callables to extend with, whose
            structure is as in `create`.

            .. note::

                Any validator callables with the same name as an existing one
                will (silently) replace the old validator callable entirely,
                effectively overriding any validation done in the "parent"
                validator class.

                If you wish to instead extend the behavior of a parent's
                validator callable, delegate and call it directly in the new
                validator function by retrieving it using
                ``OldValidator.VALIDATORS["validator_name"]``.

        version (str):

            a version for the new validator class

        type_checker (jsonschema.TypeChecker):

            a type checker, used when applying the :validator:`type` validator.

            If unprovided, the type checker of the extended
            `jsonschema.IValidator` will be carried along.`

    Returns:

        a new `jsonschema.IValidator` class extending the one provided

    .. note:: Meta Schemas

        The new validator class will have its parent's meta schema.

        If you wish to change or extend the meta schema in the new
        validator class, modify ``META_SCHEMA`` directly on the returned
        class. Note that no implicit copying is done, so a copy should
        likely be made before modifying it, in order to not affect the
        old validator.
    s‚   Cannot extend a validator created with default_types with a type_checker. Update the validator to use a type_checker when created.Ri   R(   R.   Rj   R>   N(
   R"   RO   t   updateR3   R?   R2   Rm   Rt   R*   R)   (   RK   R(   R.   Rj   t   all_validators(    (    s4   lib/python2.7/site-packages/jsonschema/validators.pyt   extendo  s    5		Ri   t   draft3R(   u   $refu   additionalItemsu   additionalPropertiesu   dependenciesu   disallowu   divisibleByu   enumu   extendsu   formatu   itemsu   maxItemsu	   maxLengthu   maximumu   minItemsu	   minLengthu   minimumu   patternu   patternPropertiesu
   propertiesu   typeu   uniqueItemsRj   R.   R>   c         C   s   |  j  d d ƒ S(   Nu   idRl   (   R:   (   R;   (    (    s4   lib/python2.7/site-packages/jsonschema/validators.pyt   <lambda>Ó  Rl   t   draft4u   allOfu   anyOfu   maxPropertiesu   minPropertiesu
   multipleOfu   notu   oneOfu   requiredc         C   s   |  j  d d ƒ S(   Nu   idRl   (   R:   (   R;   (    (    s4   lib/python2.7/site-packages/jsonschema/validators.pyRy   ö  Rl   t   draft6u   constu   containsu   exclusiveMaximumu   exclusiveMinimumu   propertyNamest   draft7u   ifRA   c           B   s°   e  Z d  Z d e d d d d „ Z e e d „ ƒ Z d „  Z	 d „  Z
 e d „  ƒ Z e d „  ƒ Z e j d „  ƒ Z e j d „  ƒ Z d	 „  Z d
 „  Z d „  Z d „  Z RS(   s  
    Resolve JSON References.

    Arguments:

        base_uri (str):

            The URI of the referring document

        referrer:

            The actual referring document

        store (dict):

            A mapping from URIs to documents to cache

        cache_remote (bool):

            Whether remote refs should be cached after first resolution

        handlers (dict):

            A mapping from URI schemes to functions that should be used
            to retrieve them

        urljoin_cache (functools.lru_cache):

            A cache that will be used for caching the results of joining
            the resolution scope to subscopes.

        remote_cache (functools.lru_cache):

            A cache that will be used for caching the results of
            resolved remote URLs.

    Attributes:

        cache_remote (bool):

            Whether remote refs should be cached after first resolution
    c         C   sÇ   | d  k r! t d ƒ t ƒ } n  | d  k rE t d ƒ |  j ƒ } n  | |  _ | |  _ t | ƒ |  _ | g |  _ t	 j
 d „  t t ƒ Dƒ ƒ |  _ |  j j | ƒ | |  j | <| |  _ | |  _ d  S(   Ni   c         s   s$   |  ] \ } } | | j  f Vq d  S(   N(   R*   (   t   .0t   idRK   (    (    s4   lib/python2.7/site-packages/jsonschema/validators.pys	   <genexpr>Œ  s   (   R3   R   R   t   resolve_from_urlt   referrert   cache_remoteR"   t   handlerst   _scopes_stackR   t   URIDictR
   R+   t   storeRu   t   _urljoin_cachet   _remote_cache(   R   t   base_uriR€   R…   R   R‚   t   urljoin_cachet   remote_cache(    (    s4   lib/python2.7/site-packages/jsonschema/validators.pyRE   w  s    
			c         O   s   |  d | | ƒ d | | | Ž S(   s½   
        Construct a resolver from a JSON schema object.

        Arguments:

            schema:

                the referring schema

        Returns:

            `RefResolver`
        Rˆ   R€   (    (   R,   R;   R>   R\   R]   (    (    s4   lib/python2.7/site-packages/jsonschema/validators.pyRB   •  s    c         C   s#   |  j  j |  j |  j | ƒ ƒ d  S(   N(   Rƒ   t   appendR†   t   resolution_scope(   R   RU   (    (    s4   lib/python2.7/site-packages/jsonschema/validators.pyRN   §  s    	c         C   s8   y |  j  j ƒ  Wn  t k
 r3 t j d ƒ ‚ n Xd  S(   Nsn   Failed to pop the scope from an empty stack. `pop_scope()` should only be called once for every `push_scope()`(   Rƒ   t   popt
   IndexErrorR   t   RefResolutionError(   R   (    (    s4   lib/python2.7/site-packages/jsonschema/validators.pyRS   ¬  s
    c         C   s   |  j  d S(   Niÿÿÿÿ(   Rƒ   (   R   (    (    s4   lib/python2.7/site-packages/jsonschema/validators.pyRŒ   ¶  s    c         C   s   t  |  j ƒ \ } } | S(   N(   R   RŒ   (   R   t   urit   _(    (    s4   lib/python2.7/site-packages/jsonschema/validators.pyRˆ   º  s    c         c   s(   |  j  | ƒ z	 d  VWd  |  j ƒ  Xd  S(   N(   RN   RS   (   R   RU   (    (    s4   lib/python2.7/site-packages/jsonschema/validators.pyt   in_scope¿  s    	c         c   s=   |  j  | ƒ \ } } |  j | ƒ z	 | VWd |  j ƒ  Xd S(   sÛ   
        Resolve the given ``ref`` and enter its resolution scope.

        Exits the scope on exit of this context manager.

        Arguments:

            ref (str):

                The reference to resolve
        N(   t   resolveRN   RS   (   R   RV   t   urlt   resolved(    (    s4   lib/python2.7/site-packages/jsonschema/validators.pyt	   resolvingÇ  s
    	c         C   s(   |  j  |  j | ƒ } | |  j | ƒ f S(   N(   R†   RŒ   R‡   (   R   RV   R”   (    (    s4   lib/python2.7/site-packages/jsonschema/validators.pyR“   Ü  s    c         C   s   t  | ƒ \ } } y |  j | } WnI t k
 rn y |  j | ƒ } Wqo t k
 rj } t j | ƒ ‚ qo Xn X|  j | | ƒ S(   N(   R   R…   t   KeyErrort   resolve_remotet	   ExceptionR   R   t   resolve_fragment(   R   R”   t   fragmentt   documentt   exc(    (    s4   lib/python2.7/site-packages/jsonschema/validators.pyR   à  s    c         C   sÔ   | j  d ƒ } | r* t | ƒ j d ƒ n g  } x | D]• } | j d d ƒ j d d ƒ } t | t ƒ r‘ y t | ƒ } Wq‘ t k
 r q‘ Xn  y | | } Wq7 t t	 f k
 rË t
 j d | ƒ ‚ q7 Xq7 W| S(   sð   
        Resolve a ``fragment`` within the referenced ``document``.

        Arguments:

            document:

                The referent document

            fragment (str):

                a URI fragment to resolve within it
        u   /u   ~1u   ~0u   ~s   Unresolvable JSON pointer: %r(   t   lstripR   t   splitRs   R   R   t   intt
   ValueErrorRm   t   LookupErrorR   R   (   R   Rœ   R›   t   partst   part(    (    s4   lib/python2.7/site-packages/jsonschema/validators.pyRš   ì  s    !c         C   sØ   y d d l  } Wn t k
 r) d } n Xt | ƒ j } | |  j k r^ |  j | | ƒ } n] | d k rˆ | rˆ | j | ƒ j ƒ  } n3 t | ƒ % } t j	 | j
 ƒ  j d ƒ ƒ } Wd QX|  j rÔ | |  j | <n  | S(   sî  
        Resolve a remote ``uri``.

        If called directly, does not check the store first, but after
        retrieving the document at the specified URI it will be saved in
        the store if :attr:`cache_remote` is True.

        .. note::

            If the requests_ library is present, ``jsonschema`` will use it to
            request the remote ``uri``, so that the correct encoding is
            detected and used.

            If it isn't, or if the scheme of the ``uri`` is not ``http`` or
            ``https``, UTF-8 is assumed.

        Arguments:

            uri (str):

                The URI to resolve

        Returns:

            The retrieved document

        .. _requests: https://pypi.org/project/requests/
        iÿÿÿÿNu   httpu   httpss   utf-8(   u   httpu   https(   t   requestst   ImportErrorR3   R   t   schemeR‚   R:   t   jsonR   t   loadst   readt   decodeR   R…   (   R   R   R¥   R§   t   resultR”   (    (    s4   lib/python2.7/site-packages/jsonschema/validators.pyR˜     s    
$	(    (    N(   R   R   R   R9   R3   RE   Rf   R<   RB   RN   RS   R7   RŒ   Rˆ   t
   contextlibt   contextmanagerR’   R–   R“   R   Rš   R˜   (    (    (    s4   lib/python2.7/site-packages/jsonschema/validators.pyRA   K  s$   *		
			$c         O   sk   | d k r t | ƒ } n  | j | ƒ | | | | Ž } t j | j |  ƒ ƒ } | d k	 rg | ‚ n  d S(   s  
    Validate an instance under the given schema.

        >>> validate([2, 3, 4], {"maxItems": 2})
        Traceback (most recent call last):
            ...
        ValidationError: [2, 3, 4] is too long

    :func:`validate` will first verify that the provided schema is itself
    valid, since not doing so can lead to less obvious error messages and fail
    in less obvious or consistent ways.

    If you know you have a valid schema already, especially if you
    intend to validate multiple instances with the same schema, you
    likely would prefer using the `IValidator.validate` method directly
    on a specific validator (e.g. ``Draft7Validator.validate``).


    Arguments:

        instance:

            The instance to validate

        schema:

            The schema to validate with

        cls (IValidator):

            The class that will be used to validate the instance.

    If the ``cls`` argument is not provided, two things will happen in
    accordance with the specification. First, if the schema has a
    :validator:`$schema` property containing a known meta-schema [#]_ then the
    proper validator will be used.  The specification recommends that all
    schemas contain :validator:`$schema` properties for this reason. If no
    :validator:`$schema` property is found, the default validator class is
    the latest released draft.

    Any other provided positional and keyword arguments will be passed on when
    instantiating the ``cls``.

    Raises:

        `jsonschema.exceptions.ValidationError` if the instance
            is invalid

        `jsonschema.exceptions.SchemaError` if the schema itself
            is invalid

    .. rubric:: Footnotes
    .. [#] known by a validator registered with
        `jsonschema.validators.validates`
    N(   R3   t   validator_forRJ   R   t
   best_matchRF   (   R   R;   R,   R\   R]   RK   RI   (    (    s4   lib/python2.7/site-packages/jsonschema/validators.pyR^   D  s    8c         C   sb   |  t  k s$ |  t k s$ d |  k r( | S|  d t k rN t d t d d ƒn  t j |  d t ƒ S(   s  
    Retrieve the validator class appropriate for validating the given schema.

    Uses the :validator:`$schema` property that should be present in the given
    schema to look up the appropriate validator class.

    Arguments:

        schema (collections.Mapping or bool):

            the schema to look at

        default:

            the default to return if the appropriate validator class cannot be
            determined.

            If unprovided, the default is to return
            the latest supported draft.
    u   $schemas‚   The metaschema specified by $schema was not found. Using the latest draft to validate, but this will raise an error in the future.R1   i   (   R9   R   R+   R   R4   R:   t   _LATEST_VERSION(   R;   t   default(    (    s4   lib/python2.7/site-packages/jsonschema/validators.pyR¯   †  s    $
(    (    (    (f   t
   __future__R    t   warningsR   R­   R¨   t   numberst   sixR   t
   jsonschemaR   R   R   R   R   t   jsonschema.compatR   R	   R
   R   R   R   R   R   R   R   t   jsonschema.exceptionsR   R™   R   R(   R„   R+   R&   t   listR   Rb   R3   t   NumberR"   Ro   Rn   Rp   R0   R5   R6   R<   Rt   Rw   t   load_schemaRV   t   additionalItemst   additionalPropertiest   dependencies_draft3t   disallow_draft3t
   multipleOft   enumt   extends_draft3t   formatt   items_draft3_draft4t   maxItemst	   maxLengtht   maximum_draft3_draft4t   minItemst	   minLengtht   minimum_draft3_draft4t   patternt   patternPropertiest   properties_draft3t   type_draft3t   uniqueItemst   draft3_type_checkert   Draft3Validatort   allOft   anyOft   dependenciest   maxPropertiest   minPropertiest   not_t   oneOft
   propertiest   requiredt   draft4_type_checkert   Draft4Validatort   constt   containst   exclusiveMaximumt   exclusiveMinimumt   itemst   maximumt   minimumt   propertyNamest   draft6_type_checkert   Draft6Validatort   if_t   draft7_type_checkert   Draft7ValidatorR±   Rq   RA   R^   R¯   (    (    (    s4   lib/python2.7/site-packages/jsonschema/validators.pyt   <module>   sR  (F"

				ÏI



















	
























	





























		






























		ùB