JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3RbrJFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3RbrB pSe0@sddlZddlZddlZddlZddlmZmZmZGdddeZGddde Z ddZ dd d Z d d Z ddZddZddZddZddZddZe e fddZddZdS)N)MutableMapping str_typesurlsplitc@sPeZdZdZddZddZddZdd Zd d Zd d Z ddZ ddZ dS)URIDictz8 Dictionary which uses normalized URIs as keys. cCs t|S)N)rZgeturl)selfurirB/opt/alt/python37/lib/python3.7/site-packages/jsonschema/_utils.py normalizeszURIDict.normalizecOst|_|jj||dS)N)dictstoreupdate)rargskwargsrrr __init__szURIDict.__init__cCs|j||S)N)r r )rrrrr __getitem__szURIDict.__getitem__cCs||j||<dS)N)r r )rrvaluerrr __setitem__szURIDict.__setitem__cCs|j||=dS)N)r r )rrrrr __delitem__szURIDict.__delitem__cCs t|jS)N)iterr )rrrr __iter__szURIDict.__iter__cCs t|jS)N)lenr )rrrr __len__!szURIDict.__len__cCs t|jS)N)reprr )rrrr __repr__$szURIDict.__repr__N) __name__ __module__ __qualname____doc__r rrrrrrrrrrr r src@seZdZdZddZdS)UnsetzG An as-of-yet unset attribute or unprovided default parameter. cCsdS)Nzr)rrrr r-szUnset.__repr__N)rrrrrrrrr r(srcCs"tdd|}t|dS)zC Load a schema from ./schemas/``name``.json and return it. Z jsonschemazschemas/{0}.jsonzutf-8)pkgutilget_dataformatjsonloadsdecode)namedatarrr load_schema1sr(csdfdd|DS)z> A dumb version of `textwrap.indent` from Python 3.3.  c3s|]}dd|VqdS) Nr).0line)timesrr ?szindent..)join splitlines)stringr/r)r/r indent:sr4cCs |sdSdddd|DS)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][css|]}t|VqdS)N)r)r-indexrrr r0Qsz"format_as_index..)r1)indicesrrr format_as_indexBs r8ccsP|di}d|di}x,|D]$}||kr$|rBt||rBq$|Vq$WdS)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|ZpatternPropertiesN)getr1research)instanceZschemar9Zpatternspropertyrrr find_additional_propertiesTs  r@cCs.t|dkrd}nd}ddd|D|fS)z@ Create an error message for extra items or properties. r)ZwasZwerez, css|]}t|VqdS)N)r)r-Zextrarrr r0pszextras_msg..)rr1)ZextrasZverbrrr extras_msggs rAc Cs^g}xF|D]>}y|t|dWq tk rF|t|Yq Xq Wd|d|fS)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%r is not of type %sz, )appendr Exceptionr1)r>typesZreprstyperrr types_msgss  rFcCsPt}t|ts|f}x0|D](}t|tr:|t|q||qWt|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 isinstancetupler flattenadd)Zsuitable_for_isinstancerDthingrrr rJs    rJcCst|tr|gS|S)z] Wrap ``thing`` in a list if it's a single str. Otherwise, return it unchanged. )rHr)rLrrr ensure_lists rMcCst|t|kS)zQ Check if two things are equal, but evade booleans and ints being equal. )unbool)ZoneZtworrr equalsrOcCs|dkr |S|dkr|S|S)zH A hack to make True and 1 and False and 0 unique for ``uniq``. TFr)elementtruefalserrr rNs rNc Csyttdd|Dt|kStk ryHtdd|D}t|dd}x"t||D]\}}||kr\dSq\WWnHttfk rg}x*|D]"}t|}||krdS| |qWYnXYnXdS)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. css|]}t|VqdS)N)rN)r-irrr r0szuniq..css|]}t|VqdS)N)rN)r-rSrrr r0sr)NFT) rrG TypeErrorsorted itertoolsislicezipNotImplementedErrorrNrB)Z containersortZslicedrSjseenerrr uniqs"   r^)r))rVr#r r<Zjsonschema.compatrrrrobjectrr(r4r8r@rArFrJrMrOrNr^rrrr s"