Viewing File: /opt/imunify360/venv/lib/python3.11/site-packages/jsonschema/__pycache__/_utils.cpython-311.pyc



]j0ddlZddlZddlZddlZddlmZmZmZGddeZGdde	Z
dZdd	Zd
Z
dZdZd
ZdZdZdZe	e	fdZdZdS)N)MutableMapping	str_typesurlsplitcBeZdZdZdZdZdZdZdZdZ	dZ
d	Zd
S)URIDictz8
    Dictionary which uses normalized URIs as keys.
    cDt|SN)rgeturlselfuris  q/builddir/build/BUILD/imunify360-venv-2.6.3/opt/imunify360/venv/lib/python3.11/site-packages/jsonschema/_utils.py	normalizezURIDict.normalizes}}##%%%cPt|_|jj|i|dSr	)dictstoreupdate)rargskwargss   r__init__zURIDict.__init__s-VV

4*6*****rcB|j||Sr	rrrs  r__getitem__zURIDict.__getitem__sz$..--..rc@||j||<dSr	r)rr
values   r__setitem__zURIDict.__setitem__s */
4>>#&&'''rc<|j||=dSr	rrs  r__delitem__zURIDict.__delitem__sJt~~c**+++rc*t|jSr	)iterrrs r__iter__zURIDict.__iter__DJrc*t|jSr	)lenrr"s r__len__zURIDict.__len__!s4:rc*t|jSr	)reprrr"s r__repr__zURIDict.__repr__$r$rN)__name__
__module____qualname____doc__rrrrrr#r'r*rrrr	s&&&+++///000,,,        rrceZdZdZdZdS)UnsetzG
    An as-of-yet unset attribute or unprovided default parameter.
    cdS)Nz<unset>r/r"s rr*zUnset.__repr__-syrN)r+r,r-r.r*r/rrr1r1(s-rr1ctjdd|}tj|dS)zC
    Load a schema from ./schemas/``name``.json and return it.
    
jsonschemazschemas/{0}.jsonzutf-8)pkgutilget_dataformatjsonloadsdecode)namedatas  rload_schemar=1sA
L*<*C*CD*I*IJJD:dkk'**+++rcjdfd|DS)z>
    A dumb version of `textwrap.indent` from Python 3.3.
    
c3.K|]}ddzz|zVdS) Nr/).0linetimess  r	<genexpr>zindent.<locals>.<genexpr>?s1NN$SAI&-NNNNNNr)join
splitlines)stringrFs `rindentrK:s8
99NNNN&:K:K:M:MNNNNNNrcN|sdSddd|DzS)z
    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.
    z[%s]z][c34K|]}t|VdSr	r))rDindexs  rrGz"format_as_index.<locals>.<genexpr>Qs(??ed5kk??????r)rH)indicess rformat_as_indexrRBs7rDII??w???????rc#K|di}d|di}|D]"}||vr|rtj||r|V#dS)z
    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.
    
properties|patternPropertiesN)getrHresearch)instanceschemarTpatternspropertys     rfind_additional_propertiesr^TsL"--Jxx

#6;;<<H:%%
BIh99
NNN	rctt|dkrd}nd}dd|D|fS)z@
    Create an error message for extra items or properties.
    r>waswere, c34K|]}t|VdSr	rO)rDextras  rrGzextras_msg.<locals>.<genexpr>ps(55UT%[[555555r)r&rH)extrasverbs  r
extras_msgrggsG
6{{a9955f55555t;;rcg}|D]]}	|t|d,#t$r%|t|YZwxYw|dd|S)a+
    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;z is not of type rb)appendr)	ExceptionrH)rZtypesreprstypes    r	types_msgrnss
E%%	%LLd6l++,,,,	%	%	%LLd$$$$$	%%-XXtyy/?/?/?@@s(1,A A ct}t|ts|f}|D]O}t|tr#|t	|:||Pt|S)z
    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.
    )set
isinstancetuplerflattenadd)suitable_for_isinstancerkthings   rrsrss
EEE-u55=#:"<(eU##	LL((((IIe<<rc6t|tr|gS|S)z]
    Wrap ``thing`` in a list if it's a single str.

    Otherwise, return it unchanged.
    )rqr)rvs rensure_listrxs"%##wLrcBt|t|kS)zQ
    Check if two things are equal, but evade booleans and ints being equal.
    unbool)onetwos  requalr~s#;;&++%%rc|dur|S|dur|S|S)zH
    A hack to make True and 1 and False and 0 unique for ``uniq``.
    TFr/)elementtruefalses   rr{r{s'
$	E		Nrc	ttd|Dt|kS#t$r	td|D}t	j|dd}t
||D]\}}||krYdSnK#ttf$r7g}|D]/}t|}||vrYYdS|	|0YnwxYwYnwxYwdS)z
    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.
    c34K|]}t|VdSr	rzrDis  rrGzuniq.<locals>.<genexpr>s(44Qvayy444444rc34K|]}t|VdSr	rzrs  rrGzuniq.<locals>.<genexpr>s(77&))777777rr>NFT)
r&rp	TypeErrorsorted	itertoolsislicezipNotImplementedErrorr{ri)	containersortslicedrjseenes       runiqrs9344)4444455YGG


	77Y77777D%dAt44FD&))
!
!166 555
!$Y/			D

1II99 5555A	

	
4sF69
C"ABBC"+C?C"CC"CC"!C")r>)rr8r5rXjsonschema.compatrrrrobjectr1r=rKrRr^rgrnrsrxr~r{rr/rr<module>rst				AAAAAAAAAA     n   >F,,,OOOO@@@$&	<	<	<AAA&,			&&& 				r
Back to Directory File Manager