,K9 <ddlZddlmZddlZddlmZmZddlmZdZ dZ dZ dZ d Z d Zd Zd Zejd GddeZeee e e ee e edZedZeddZeZdS)N)pmap) int_types str_types)UndefinedTypeCheckc,t|tSN) isinstancelistcheckerinstances c/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/jsonschema/_types.pyis_arrayr  h % %%c,t|tSr)r boolr s ris_boolrrrcZt|trdSt|tSNF)r rrr s r is_integerrs)(D!!u h * **rc |duSrr s ris_nullrs t rcdt|trdSt|tjSr)r rnumbersNumberr s r is_numberrs+(D!!u h / //rc,t|tSr)r dictr s r is_objectr!$rrc,t|tSr)r rr s r is_stringr#(s h * **rcdS)NTrr s ris_anyr%,s 4rT)frozenc`eZdZdZejeeZdZdZ d dZ dZ dS) TypeCheckera A ``type`` property checker. A `TypeChecker` performs type checking for an `IValidator`. Type checks to perform are updated using `TypeChecker.redefine` or `TypeChecker.redefine_many` and removed via `TypeChecker.remove`. Each of these return a new `TypeChecker` object. Arguments: type_checkers (dict): The initial mapping of types to their checking functions. )default convertercr |j|}n#t$rt|wxYw|||S)a Check if the instance is of the appropriate type. Arguments: instance (object): The instance to check type (str): The name of the type that is expected. Returns: bool: Whether it conformed. Raises: `jsonschema.exceptions.UndefinedTypeCheck`: if type is unknown to this object. )_type_checkersKeyErrorr)selfr typefns ris_typezTypeChecker.is_typeBsS0 +$T*BB + + +$T** * +r$!!!s *c0|||iS)a Produce a new checker with the given type redefined. Arguments: type (str): The name of the type to check. fn (collections.Callable): A function taking exactly two parameters - the type checker calling the function and the instance to check. The function should return true if instance is of this type and false otherwise. Returns: A new `TypeChecker` instance. ) redefine_many)r.r/r0s rredefinezTypeChecker.redefineas*!!4*---rrc^tj||j|S)a Produce a new checker with the given types redefined. Arguments: definitions (dict): A dictionary mapping types to their checking functions. Returns: A new `TypeChecker` instance.  type_checkers)attrevolver,update)r. definitionss rr3zTypeChecker.redefine_manyxs3{  3 : :; G G    rc|j}|D]5} ||}#t$rt|wxYwt j||S)a} Produce a new checker with the given types forgotten. Arguments: types (~collections.Iterable): the names of the types to remove. Returns: A new `TypeChecker` instance Raises: `jsonschema.exceptions.UndefinedTypeCheck`: if any given type is unknown to this object r6)r,remover-rr8r9)r.typescheckerseachs rr=zTypeChecker.removesq*& / /D /#??400 / / /(... /{4x8888s#=N)r) __name__ __module__ __qualname____doc__r8ibrr,r1r4r3r=rrrr(r(0s}  TWTTVVt<<....    $99999rr()anyarraybooleanintegerobjectnullnumberstringrFrIctt||p(t|to|Sr)rr floatr s rrPs77H%% >8U##=(;(;(=(=r)r pyrsistentrr8jsonschema.compatrrjsonschema.exceptionsrrrrrrr!r#r%srJr(draft3_type_checkerr=draft4_type_checkerr4draft6_type_checkerdraft7_type_checkerrrrrYs 22222222444444&&&&&&+++000&&&+++tt9t9t9t9t9&t9t9t9n"k    *0088)22*r