%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/227033/root/opt/alt/python27/lib/python2.7/site-packages/jsonschema/
Upload File :
Create Path :
Current File : //proc/227033/root/opt/alt/python27/lib/python2.7/site-packages/jsonschema/_utils.pyc

�
���Xc@s�ddlZddlZddlZddlZddlmZmZmZdefd��YZde	fd��YZ
d�Zdd	�Zd
�Z
d�Zd�Zd
�Zd�Zd�Ze	�e	�d�Zd�ZdS(i����N(t	str_typestMutableMappingturlsplittURIDictcBsVeZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
RS(	s9
    Dictionary which uses normalized URIs as keys.

    cCst|�j�S(N(Rtgeturl(tselfturi((sB/opt/alt/python27/lib/python2.7/site-packages/jsonschema/_utils.pyt	normalizescOs#t�|_|jj||�dS(N(tdicttstoretupdate(Rtargstkwargs((sB/opt/alt/python27/lib/python2.7/site-packages/jsonschema/_utils.pyt__init__scCs|j|j|�S(N(R	R(RR((sB/opt/alt/python27/lib/python2.7/site-packages/jsonschema/_utils.pyt__getitem__scCs||j|j|�<dS(N(R	R(RRtvalue((sB/opt/alt/python27/lib/python2.7/site-packages/jsonschema/_utils.pyt__setitem__scCs|j|j|�=dS(N(R	R(RR((sB/opt/alt/python27/lib/python2.7/site-packages/jsonschema/_utils.pyt__delitem__scCs
t|j�S(N(titerR	(R((sB/opt/alt/python27/lib/python2.7/site-packages/jsonschema/_utils.pyt__iter__scCs
t|j�S(N(tlenR	(R((sB/opt/alt/python27/lib/python2.7/site-packages/jsonschema/_utils.pyt__len__"scCs
t|j�S(N(treprR	(R((sB/opt/alt/python27/lib/python2.7/site-packages/jsonschema/_utils.pyt__repr__%s(t__name__t
__module__t__doc__RR
RRRRRR(((sB/opt/alt/python27/lib/python2.7/site-packages/jsonschema/_utils.pyR	s							tUnsetcBseZdZd�ZRS(sH
    An as-of-yet unset attribute or unprovided default parameter.

    cCsdS(Ns<unset>((R((sB/opt/alt/python27/lib/python2.7/site-packages/jsonschema/_utils.pyR/s(RRRR(((sB/opt/alt/python27/lib/python2.7/site-packages/jsonschema/_utils.pyR)scCs1tjddj|��}tj|jd��S(sD
    Load a schema from ./schemas/``name``.json and return it.

    t
jsonschemasschemas/{0}.jsonsutf-8(tpkgutiltget_datatformattjsontloadstdecode(tnametdata((sB/opt/alt/python27/lib/python2.7/site-packages/jsonschema/_utils.pytload_schema3sics#dj�fd�|j�D��S(sE
    A dumb version of :func:`textwrap.indent` from Python 3.3.

    s
c3s!|]}dd�|VqdS(t iN((t.0tline(ttimes(sB/opt/alt/python27/lib/python2.7/site-packages/jsonschema/_utils.pys	<genexpr>Cs(tjoint
splitlines(tstringR)((R)sB/opt/alt/python27/lib/python2.7/site-packages/jsonschema/_utils.pytindent=scCs%|s
dSddjd�|D��S(s�
    Construct a single string containing indexing operations for the indices.

    For example, [1, 2, "foo"] -> [1][2]["foo"]

    Arguments:

        indices (sequence):

            The indices to format.

    ts[%s]s][css|]}t|�VqdS(N(R(R'tindex((sB/opt/alt/python27/lib/python2.7/site-packages/jsonschema/_utils.pys	<genexpr>Vs(R*(tindices((sB/opt/alt/python27/lib/python2.7/site-packages/jsonschema/_utils.pytformat_as_indexFsccst|jdi�}dj|jdi��}x@|D]8}||kr4|rdtj||�rdq4n|Vq4q4WdS(s�
    Return the set of additional properties for the given ``instance``.

    Weeds out properties that should have been validated by ``properties`` and
    / or ``patternProperties``.

    Assumes ``instance`` is dict-like already.

    t
propertiest|tpatternPropertiesN(tgetR*tretsearch(tinstancetschemaR2tpatternstproperty((sB/opt/alt/python27/lib/python2.7/site-packages/jsonschema/_utils.pytfind_additional_propertiesYs
cCs>t|�dkrd}nd}djd�|D��|fS(sA
    Create an error message for extra items or properties.

    itwastweres, css|]}t|�VqdS(N(R(R'textra((sB/opt/alt/python27/lib/python2.7/site-packages/jsonschema/_utils.pys	<genexpr>ws(RR*(textrastverb((sB/opt/alt/python27/lib/python2.7/site-packages/jsonschema/_utils.pyt
extras_msgms	cCspg}xP|D]H}y|jt|d��Wq
tk
rT|jt|��q
Xq
Wd|dj|�fS(s,
    Create an error message for a failure to match the given types.

    If the ``instance`` is an object and contains a ``name`` property, it will
    be considered to be a description of that object and used as its type.

    Otherwise the message is simply the reprs of the given ``types``.

    R#s%r is not of type %ss, (tappendRt	ExceptionR*(R8ttypestreprsttype((sB/opt/alt/python27/lib/python2.7/site-packages/jsonschema/_utils.pyt	types_msgzs

cCsqt�}t|t�s$|f}nx@|D]8}t|t�rV|jt|��q+|j|�q+Wt|�S(s�
    isinstance() can accept a bunch of really annoying different types:
        * a single type
        * a tuple of types
        * an arbitrary nested tree of tuples

    Return a flattened tuple of the given argument.

    (tsett
isinstancettupleR
tflattentadd(tsuitable_for_isinstanceREtthing((sB/opt/alt/python27/lib/python2.7/site-packages/jsonschema/_utils.pyRL�s	
cCst|t�r|gS|S(s^
    Wrap ``thing`` in a list if it's a single str.

    Otherwise, return it unchanged.

    (RJR(RO((sB/opt/alt/python27/lib/python2.7/site-packages/jsonschema/_utils.pytensure_list�scCs$|tkr|S|tkr |S|S(sI
    A hack to make True and 1 and False and 0 unique for ``uniq``.

    (tTruetFalse(telementttruetfalse((sB/opt/alt/python27/lib/python2.7/site-packages/jsonschema/_utils.pytunbool�s
cCs�y*ttd�|D���t|�kSWn�tk
r�y_td�|D��}tj|dd�}x-t||�D]\}}||krxtSqxWWq�t	tfk
r�g}x;|D]/}t
|�}||kr�tS|j|�q�Wq�XnXtS(s�
    Check if all of a container's elements are unique.

    Successively tries first to rely that the elements are hashable, then
    falls back on them being sortable, and finally falls back on brute
    force.

    css|]}t|�VqdS(N(RV(R'ti((sB/opt/alt/python27/lib/python2.7/site-packages/jsonschema/_utils.pys	<genexpr>�scss|]}t|�VqdS(N(RV(R'RW((sB/opt/alt/python27/lib/python2.7/site-packages/jsonschema/_utils.pys	<genexpr>�siN(
RRIt	TypeErrortsortedt	itertoolstislicetNonetzipRRtNotImplementedErrorRVRCRQ(t	containertsorttslicedRWtjtseente((sB/opt/alt/python27/lib/python2.7/site-packages/jsonschema/_utils.pytuniq�s"
*

(RZR RR6tjsonschema.compatRRRRtobjectRR%R-R1R<RBRHRLRPRVRe(((sB/opt/alt/python27/lib/python2.7/site-packages/jsonschema/_utils.pyt<module>s  
	
				
			


Zerion Mini Shell 1.0