
    \Di                       S r SSKJr  SSKrSSKrSSKrSSKrSSKrSSK	r	SSK
r
SSKrSSKrSSKrSSKJr  SSKJrJr  SSKJr  SSKJr  SSKJrJrJr  SS	KJr  SS
KJrJrJ r J!r!J"r"J#r#  SSK$J%r%  SSK&J'r'J(r(J)r)  SSK*J+r+  SSK,J-r-J.r.J/r/J0r0J1r1J2r2J3r3J4r4J5r5  SSK6J7r7  \Rp                  (       a  SSK9J:r:  SS jr;SS jr< " S S\5      r= " S S5      r> " S S\R~                  \=S9r@\@rAg)zvThe `Schema <marshmallow.Schema>` class, including its metaclass and options (`class Meta <marshmallow.Schema.Meta>`).    )annotationsN)ABCMeta)OrderedDictdefaultdict)Mapping)zip_longest)baseclass_registrytypes)fields)	POST_DUMP	POST_LOADPRE_DUMPPRE_LOAD	VALIDATESVALIDATES_SCHEMA)
ErrorStore)SCHEMAStringNotCollectionErrorValidationError)
OrderedSet)	EXCLUDEINCLUDERAISE	get_valueis_collectionis_instance_or_subclassmissing	set_value validate_unknown_parameter_value)RemovedInMarshmallow4Warning)Fieldc                    U R                  5        VVs/ s H)  u  p[        U[        R                  5      (       d  M&  X4PM+     snn$ s  snnf )zCGet fields from a class

:param attrs: Mapping of class attributes
)itemsr   r	   FieldABC)attrs
field_namefield_values      Z/var/www/html/Aiprofessor/professorTrac/lib/python3.13/site-packages/marshmallow/schema.py_get_fieldsr*   2   sE     (-{{}'4#J";> 	"!'4  s
   %AA
SchemaMetac                    [         R                  " U 5      n[        R                  " [        R
                  S USSS2    5       / 5      $ )a  Collect fields from a class, following its method resolution order. The
class itself is excluded from the search; only its parents are checked. Get
fields from ``_declared_fields`` if available, else use ``__dict__``.

:param klass: Class whose fields to retrieve
c              3  b   #    U  H%  n[        [        US UR                  5      5      v   M'     g7f)_declared_fieldsN)r*   getattr__dict__).0r	   s     r)   	<genexpr>%_get_fields_by_mro.<locals>.<genexpr>M   s6      	
 # 0$--@  #s   -/Nr   )inspectgetmro	functoolsreduceoperatoriadd)klassmros     r)   _get_fields_by_mror=   @   sL     ..
C 	
 EQrE
		
 		 	    c                     ^  \ rS rSr% SrS\S'   S\S'   S\S'   S\S	'           SU 4S
 jjr\\4         SS jj5       r	U 4S jr
SS jrSrU =r$ )r+   W   a  Metaclass for the Schema class. Binds the declared fields to
a ``_declared_fields`` attribute, which is a dictionary mapping attribute
names to field objects. Also sets the ``opts`` class attribute, which is
the Schema class's `class Meta <marshmallow.Schema.Meta>` options.
typeMeta
typing.AnyoptsOPTIONS_CLASSdict[str, Field]r.   c                0  > UR                  S5      n[        USS5      nU(       dQ  U HI  n[        US5      (       d  M  [        UR                  S5      (       d  M3  UR                  R                  n  O   Sn[        U5      nU H  u  pX8	 M	     [        TU ]  XX#5      n
[        U
5      nU
R                  nU
R                  XES9U
l
        U[        U
R                  R                  R                  5       5      -  nU R                  U
UU[        S9U
l        U
$ )NrB   orderedF)rH   )r;   
cls_fieldsinherited_fieldsdict_cls)getr/   hasattrrB   rH   r*   super__new__r=   rE   rD   listincluder$   get_declared_fieldsdictr.   )mcsnamebasesr&   metarH   base_rI   r'   _r;   rJ   	__class__s               r)   rO   SchemaMeta.__new__c   s    yy $	51
 5&))gejj).L.L#jj00G 
   '
 (MJ! (58-e4zz (((?
d5::--33566
 "%!8!8!-	 "9 "
 r>   c                    U" X2-   5      $ )a  Returns a dictionary of field_name => `Field` pairs declared on the class.
This is exposed mainly so that plugins can add additional fields, e.g. fields
computed from `class Meta <marshmallow.Schema.Meta>` options.

:param klass: The class object.
:param cls_fields: The fields declared on the class, including those added
    by the ``include`` `class Meta <marshmallow.Schema.Meta>` option.
:param inherited_fields: Inherited fields.
:param dict_cls: dict-like class to use for dict output Default to ``dict``.
 )rT   r;   rI   rJ   rK   s        r)   rR   SchemaMeta.get_declared_fields   s    $ (566r>   c                   > [         TU ]  XU5        U(       a1  U R                  R                  (       a  [        R                  " X5        U R                  5       U l        g N)rN   __init__rD   registerr
   resolve_hooks_hooks)clsrU   rV   r&   rZ   s       r)   ra   SchemaMeta.__init__   s?    e,CHH%%##D.&&(
r>   c                v  ^ [         R                  " U 5      n[        [        5      n[	        U 5       Ha  mU H  n UR
                  T   n  O   M   UR                  nUR                  5        H"  u  pgX&   R                  U4S jU 5       5        M$     Mc     U$ ! [         a     Mo  f = f! [         a     M  f = f)zAdd in the decorated processors

By doing this after constructing the class, we let standard inheritance
do all the hard work.
c              3  0   >#    U  H  u  pTX4v   M     g 7fr`   r]   )r1   manykwargs	attr_names      r)   r2   +SchemaMeta.resolve_hooks.<locals>.<genexpr>   s      &FLldD1fs   )r5   r6   r   rP   dirr0   KeyError__marshmallow_hook__r$   extendAttributeError)	re   r<   hooksparentattrhook_configtagconfigrk   s	           @r)   rc   SchemaMeta.resolve_hooks   s     nnS!9DT9JSI !??95D   --  $/#4#4#6KC J%% &FL&  $71 "> 1    " s#   BB*
B'&B'*
B87B8r]   )rU   strrV   ztuple[type, ...]r&   zdict[str, typing.Any]returnr+   )
r;   r+   rI   list[tuple[str, Field]]rJ   r{   rK   
type[dict]rz   rF   )rz   'dict[str, list[tuple[str, bool, dict]]])__name__
__module____qualname____firstlineno____doc____annotations__rO   classmethodrS   rR   ra   rc   __static_attributes____classcell__)rZ   s   @r)   r+   r+   W   s     J
&&))  ) %	)
 
)V   $77 ,7 2	7
 7 
7 7&)) )r>   c                  &    \ rS rSrSrSSS jjrSrg)
SchemaOpts   z/Defines defaults for `marshmallow.Schema.Meta`.c                   [        USS5      U l        [        U R                  [        [        45      (       d  [        S5      e[        USS5      U l        [        U R                  [        [        45      (       d  [        S5      eU R                  (       a  U R                  (       a  [        S5      e[        USS5      U l        [        U R                  [        [        45      (       d  [        S5      e[        US	S 5      U l        [        US
S 5      U l	        [        USS 5      U l
        [        US5      (       a,  [        R                  " S[        SS9  [        US[        5      nO[        n[        USU5      U l        [        US5      (       a  [        R                  " S[        SS9  [        USU5      U l        [        USS5      U l        [        US0 5      U l        [        USS5      U l        [        USS5      U l        [-        [        US[.        5      5      U l        [        USS5      U l        [        USS5      U l        g )Nr   r]   z(`fields` option must be a list or tuple.
additionalz,`additional` option must be a list or tuple.zFCannot set both `fields` and `additional` options for the same Schema.excludez"`exclude` must be a list or tuple.
dateformatdatetimeformat
timeformatjson_modulezKThe json_module class Meta option is deprecated. Use render_module instead.   
stacklevelrender_modulerH   zThe `ordered` `class Meta` option is deprecated. Field order is already preserved by default. Set `Schema.dict_class` to OrderedDict to maintain the previous behavior.index_errorsTrQ   	load_only	dump_onlyunknownrb   ri   F)r/   r   
isinstancerP   tuple
ValueErrorr   r   r   r   r   rM   warningswarnr!   jsonr   rH   r   rQ   r   r   r    r   r   rb   ri   )selfrW   rH   r   s       r)   ra   SchemaOpts.__init__   s   dHb1$++e}55GHH!$b9$//D%=99KLL;;4??X  tY3$,,u66ABB!$d;%d,<dC!$d;4''MM],
 $D->M M$T?MJ4##MM\ - tY8#D.$?tY3 {B7 {B77iQV8WXj$7D&%0	r>   )r   r   r   r   r   r   rQ   r   r   ri   rH   rb   r   r   r   N)F)rW   rA   rH   bool)r~   r   r   r   r   ra   r   r]   r>   r)   r   r      s    9*1 *1r>   r   c                     \ rS rSr% Sr\\R                  \\R                  \	R                  \R                  \\R                  \\R                  \\R"                  \\R"                  \\R"                  \\R*                  \R.                  \R.                  \	R0                  \R2                  \	R4                  \R6                  \	R8                  \R:                  \R>                  \R>                  0r S\!S'   0 r"S\!S'   SSS	.r#S\!S
'   \$r%S\!S'   \&r'S\!S'   0 r(S\!S'   0 r)S\!S'    " S S5      r*SSSSSSSSS.               S?S jjr+S@S jr,\-SAS j5       r.\/SS.     SBS jj5       r0      SCS jr1SDS jr2\3SS .S! j5       r4S"S#.SES$ jjr5SS#.SFS% jjr6SS#.SFS& jjr7S"S\8SS'.       SGS( jjr9SSSS).       SHS* jjr:SSSS).       SIS+ jjr;SS .           SJS, jjr<SSS-.       SKS. jjr=SSSS/S0.         SLS1 jjr>SMS2 jr?SMS3 jr@SMS4 jrASNS5 jrBSNS6 jrCSS7.   SOS8 jjrD      SPS9 jrESQS: jrFS"S;.         SRS< jjrGSS7.     SSS= jjrHS>rIg)TSchemai  a  Base schema class with which to define schemas.

Example usage:

.. code-block:: python

    import datetime as dt
    from dataclasses import dataclass

    from marshmallow import Schema, fields


    @dataclass
    class Album:
        title: str
        release_date: dt.date


    class AlbumSchema(Schema):
        title = fields.Str()
        release_date = fields.Date()


    album = Album("Beggars Banquet", dt.date(1968, 12, 6))
    schema = AlbumSchema()
    data = schema.dump(album)
    data  # {'release_date': '1968-12-06', 'title': 'Beggars Banquet'}

:param only: Whitelist of the declared fields to select when
    instantiating the Schema. If None, all fields are used. Nested fields
    can be represented with dot delimiters.
:param exclude: Blacklist of the declared fields to exclude
    when instantiating the Schema. If a field appears in both `only` and
    `exclude`, it is not used. Nested fields can be represented with dot
    delimiters.
:param many: Should be set to `True` if ``obj`` is a collection
    so that the object will be serialized to a list.
:param context: Optional context passed to :class:`fields.Method` and
    :class:`fields.Function` fields.
:param load_only: Fields to skip during serialization (write-only fields)
:param dump_only: Fields to skip during deserialization (read-only fields)
:param partial: Whether to ignore missing fields and not require
    any fields declared. Propagates down to ``Nested`` fields as well. If
    its value is an iterable, only missing fields listed in that iterable
    will be ignored. Use dot delimiters to specify nested fields.
:param unknown: Whether to exclude, include, or raise an error for unknown
    fields in the data. Use `EXCLUDE`, `INCLUDE` or `RAISE`.

.. versionchanged:: 3.0.0
    `prefix` parameter removed.
zdict[type, type[Field]]TYPE_MAPPINGzdict[str, str]error_messageszInvalid input type.zUnknown field.)rA   r   _default_error_messagesrA   rE   rC   rD   rF   r.   r}   rd   c                      \ rS rSr% SrS\S'    S\S'    S\S'    S\S'    S	\S
'    S\S'    S\S'    S\S'    S\S'    S	\S'    S	\S'    S\S'    S\S'    S\S'    S	\S'   Srg)Schema.MetaiZ  aa  Options object for a Schema.

Example usage: ::

    from marshmallow import Schema


    class MySchema(Schema):
        class Meta:
            fields = ("id", "email", "date_created")
            exclude = ("password", "secret_attribute")

.. admonition:: A note on type checking

    Type checkers will only check the attributes of the `Meta <marshmallow.Schema.Meta>`
    class if you explicitly subclass `marshmallow.Schema.Meta`.

    .. code-block:: python

        from marshmallow import Schema


        class MySchema(Schema):
            # Not checked by type checkers
            class Meta:
                additional = True


        class MySchema2(Schema):
            # Type checkers will check attributes
            class Meta(Schema.Opts):
                additional = True  # Incompatible types in assignment

.. versionremoved:: 3.0.0b7 Remove ``strict``.
.. versionadded:: 3.0.0b12 Add `unknown`.
.. versionchanged:: 3.0.0b17 Rename ``dateformat`` to `datetimeformat`.
.. versionadded:: 3.9.0 Add `timeformat`.
.. versionchanged:: 3.26.0 Deprecate `ordered`. Field order is preserved by default.
z,typing.ClassVar[tuple[str, ...] | list[str]]r   r   z!typing.ClassVar[dict[str, Field]]rQ   r   ztyping.ClassVar[bool]ri   ztyping.ClassVar[str]r   r   r   rC   r   rH   r   r   r   r   rb   r]   N)r~   r   r   r   r   r   r   r]   r>   r)   rB   r   Z  s    &	P =<<@@	 32	 >=	 $#O((I,,Q((I "!	 '&`++e??7??7%%	 ('	r>   rB   Nr]   )onlyr   ri   contextr   r   partialr   c                  Ub  [        U5      (       d  [        S5      e[        U5      (       d  [        S5      e[        R                  " U R                  5      U l        Uc  U R                  R                  OUU l        Xl        [        U R                  R                  5      [        U5      -  U l
        U R                  R                  U l        [        U5      =(       d    [        U R                  R                  5      U l        [        U5      =(       d    [        U R                  R                  5      U l        Xpl        Uc  U R                  R                  O
[!        U5      U l        U(       a  ["        R$                  " S[&        SS9  U=(       d    0 U l        U R+                  5         0 U l        0 U l        0 U l        U R3                  5         0 n	U	R5                  U R6                  5        [9        U R:                  R<                  5       H  n
U	R5                  [?        U
S0 5      5        M!     U	R5                  U R@                  =(       d    0 5        Xl         g )Nz""only" should be a list of stringsz%"exclude" should be a list of stringszThe `context` parameter is deprecated and will be removed in marshmallow 4.0. Use `contextvars.ContextVar` to pass context instead.r   r   r   )!r   r   copydeepcopyr.   declared_fieldsrD   ri   r   setr   rH   r   r   r   r   r    r   r   r!   r   _normalize_nested_optionsr   load_fieldsdump_fields_init_fieldsupdater   reversedrZ   __mro__r/   r   )r   r   r   ri   r   r   r   r   r   messagesre   s              r)   ra   Schema.__init__  s    M$$7$7*+OPPW%%*+RSS#}}T-B-BC&*lDIINN		HKIII
LI yy((YC3tyy/B/B+CYC3tyy/B/B+C  II1': 	
 MMH,	 }"&&((*-/-/445DNN223COOGC)92>? 4++1r2&r>   c                P    SU R                   R                   SU R                   S3$ )N<z(many=z)>)rZ   r~   ri   r   s    r)   __repr__Schema.__repr__  s&    4>>**+6$))B??r>   c                <    U R                   (       a  [        $ [        $ )z'`dict` type to return when serializing.)rH   r   rS   r   s    r)   
dict_classSchema.dict_class  s     <<r>   GeneratedSchema)rU   c                   [        S[        U S[        5      4SS05      n[        X 40 UR                  5       ESU0E5      $ )aK  Generate a `Schema <marshmallow.Schema>` class given a dictionary of fields.

.. code-block:: python

    from marshmallow import Schema, fields

    PersonSchema = Schema.from_dict({"name": fields.Str()})
    print(PersonSchema().load({"name": "David"}))  # => {'name': 'David'}

Generated schemas are not added to the class registry and therefore cannot
be referred to by name in `Nested` fields.


:param fields: Dictionary mapping field names to field instances.
:param name: Optional name for the class, which will appear in
    the ``repr`` for the class.

.. versionadded:: 3.0.0
GeneratedMetarB   rb   F)rA   r/   objectr   )re   r   rU   rB   s       r)   	from_dictSchema.from_dict  sJ    4 gc66:<z5>Q
 D&"AV[[]"AFD"ABBr>   c                   g)ac  Custom error handler function for the schema.

:param error: The `ValidationError` raised during (de)serialization.
:param data: The original input data.
:param many: Value of ``many`` on dump or load.
:param partial: Value of ``partial`` on load.

.. versionchanged:: 3.0.0rc9
    Receives `many` and `partial` (on deserialization) as keyword arguments.
Nr]   )r   errordatari   rj   s        r)   handle_errorSchema.handle_error  s    r>   c                    [        XU5      $ )zDefines how to pull values from an object to serialize.

.. versionchanged:: 3.0.0a1
    Changed position of ``obj`` and ``attr``.
)r   )r   objrt   defaults       r)   get_attributeSchema.get_attribute$  s     G,,r>   indexc                    U " U5      nU$ ! [          a=  nUR                  UR                  X$S9  UR                  =(       d    [        s SnA$ SnAff = f)ah  Call ``getter_func`` with ``data`` as its argument, and store any `ValidationErrors`.

:param getter_func: Function for getting the serialized/deserialized
    value from ``data``.
:param data: The data passed to ``getter_func``.
:param field_name: Field name.
:param index: Index of the item being validated, if validating a collection,
    otherwise `None`.
r   N)r   store_errorr   
valid_datar   )getter_funcr   r'   error_storer   valuer   s          r)   _call_and_storeSchema._call_and_store.  sT    	/%E   	/##ENNJ#L ##.w.		/s    
A2AAAFri   c               R   U(       a#  Ub   U Vs/ s H  o0R                  USS9PM     sn$ U R                  5       nU R                  R                  5        HI  u  pVUR	                  XQU R
                  S9nU[        L a  M*  UR                  b  UR                  OUnXtU'   MK     U$ s  snf )zSerialize ``obj``.

:param obj: The object(s) to serialize.
:param many: `True` if ``data`` should be serialized as a collection.
:return: A dictionary of the serialized data
Fr   )accessor)
_serializer   r   r$   	serializer   r   data_key)	r   r   ri   dretrk   	field_objr   keys	            r)   r   Schema._serializeB  s     CO<?@CqOOAEO2C@@oo$($4$4$:$:$< I''	ASAS'TE(1(:(:(F)$$ICH %= 
 As   B$c                  Uc  U R                   O
[        U5      nU R                  [           (       a  U R	                  [        XUS9nOUnU R                  X2S9nU R                  [           (       a  U R	                  [        XBUS9nU$ )aB  Serialize an object to native Python data types according to this
Schema's fields.

:param obj: The object to serialize.
:param many: Whether to serialize `obj` as a collection. If `None`, the value
    for `self.many` is used.
:return: Serialized data

.. versionadded:: 1.0.0
.. versionchanged:: 3.0.0b7
    This method returns the serialized data rather than a ``(data, errors)`` duple.
    A :exc:`ValidationError <marshmallow.exceptions.ValidationError>` is raised
    if ``obj`` is invalid.
.. versionchanged:: 3.0.0rc9
    Validation no longer occurs upon serialization.
)ri   original_datar   )ri   r   rd   r   _invoke_dump_processorsr   r   )r   r   ri   processed_objresults        r)   dumpSchema.dumpT  s    " !Ltyyd4j;;x  88# 9 M  M:;;y!116C 2 F r>   c               t    U R                  XS9nU R                  R                  R                  " U/UQ70 UD6$ )a  Same as :meth:`dump`, except return a JSON-encoded string.

:param obj: The object to serialize.
:param many: Whether to serialize `obj` as a collection. If `None`, the value
    for `self.many` is used.
:return: A ``json`` string

.. versionadded:: 1.0.0
.. versionchanged:: 3.0.0b7
    This method returns the serialized data rather than a ``(data, errors)`` duple.
    A :exc:`ValidationError <marshmallow.exceptions.ValidationError>` is raised
    if ``obj`` is invalid.
r   )r   rD   r   dumps)r   r   ri   argsrj   
serializeds         r)   r   Schema.dumpsv  s9     YYsY.
yy&&,,ZI$I&IIr>   )ri   r   r   r   c                 ^ U R                   R                  nU(       a  UOSnU(       a~  [        T5      (       d"  UR                  U R                  S   /US9  / nU$ [        T5       V	V
s/ s H2  u  pU R                  [        R                  " [        U
5      USUUU	S9PM4     nn	n
U$ U R                  5       n[        T[        5      (       d   UR                  U R                  S   /US9  U$ [        U5      nU R                  R                  5        H  u  pUR                  b  UR                  OUnTR!                  U["        5      nU["        L a  USL d  U(       a  X;   a  MR  0 nU(       aC  US-   n[%        U5      nU Vs/ s H   nUR'                  U5      (       d  M  UUS PM"     nnUUS'   OUb  UUS'   XU4U4S	 jjnU R)                  UUUUUS
9nU["        Ld  M  UR*                  =(       d    Un[-        UUU5        M     U[.        :w  a  U R                  R                  5        VVs1 s H   u  pUR                  b  UR                  OUiM"     nnn[1        T5      U-
   HO  nTU   nU[2        :X  a  UUU'   M  U[4        :X  d  M%  UR                  U R                  S   /UU(       a  UOS5        MQ     U$ s  sn
n	f s  snf s  snnf )a;  Deserialize ``data``.

:param data: The data to deserialize.
:param error_store: Structure to store errors.
:param many: `True` if ``data`` should be deserialized as a collection.
:param partial: Whether to ignore missing fields and not require
    any fields declared. Propagates down to ``Nested`` fields as well. If
    its value is an iterable, only missing fields listed in that iterable
    will be ignored. Use dot delimiters to specify nested fields.
:param unknown: Whether to exclude, include, or raise an error for unknown
    fields in the data. Use `EXCLUDE`, `INCLUDE` or `RAISE`.
:param index: Index of the item being serialized (for storing errors) if
    serializing a collection, otherwise `None`.
:return: The deserialized data as `dict_class` instance or list of `dict_class`
instances if `many` is `True`.
NrA   r   F)r   ri   r   r   r   T.r   c                .   > UR                   " U UT40 UD6$ r`   )deserialize)valr   r'   d_kwargsr   s       r)   getter#Schema._deserialize.<locals>.getter  s+     %00" #	 r>   r   r   r'   r   r   r   )rD   r   r   r   r   	enumerate_deserializetypingcastrS   r   r   r   r   r$   r   rL   r   len
startswithr   	attributer   r   r   r   r   )r   r   r   ri   r   r   r   r   ret_lidxr   ret_dpartial_is_collectionrk   r   r'   	raw_valuer   prefix
len_prefixfsub_partialr   r   r   r   s    `                        r)   r   Schema._deserialize  s   : yy--%4 &&'')<)<V)D(EU'S L #,D/
 #2 %%D!,$/" ' '! &  #2  
 L!$((##T%8%8%@$A#Oz w %2'$:!(,(8(8(>(>(@$	*3*<*<*HI&&i  !HHZ9	'$-)2F ('#-F!$VJ07#0711<<;O*+   # +6HY'(*1HY' $-h ,, &") + -  '#--:CeS%0U )AV '! 261A1A1G1G1I1I-
 +4*<*<*HI&&jX1I   t9v-C IE')%*c
 E)#//!00;<&2U . Y
D#8s   *9J:K 	K -'Kri   r   r   c               $    U R                  XX4SS9$ )a  Deserialize a data structure to an object defined by this Schema's fields.

:param data: The data to deserialize.
:param many: Whether to deserialize `data` as a collection. If `None`, the
    value for `self.many` is used.
:param partial: Whether to ignore missing fields and not require
    any fields declared. Propagates down to ``Nested`` fields as well. If
    its value is an iterable, only missing fields listed in that iterable
    will be ignored. Use dot delimiters to specify nested fields.
:param unknown: Whether to exclude, include, or raise an error for unknown
    fields in the data. Use `EXCLUDE`, `INCLUDE` or `RAISE`.
    If `None`, the value for `self.unknown` is used.
:return: Deserialized data

.. versionadded:: 1.0.0
.. versionchanged:: 3.0.0b7
    This method returns the deserialized data rather than a ``(data, errors)`` duple.
    A :exc:`ValidationError <marshmallow.exceptions.ValidationError>` is raised
    if invalid data are passed.
Tri   r   r   postprocess)_do_load)r   r   ri   r   r   s        r)   loadSchema.load  s!    > }}W4  
 	
r>   c               p    U R                   R                  R                  " U40 UD6nU R                  XbX4S9$ )a"  Same as :meth:`load`, except it uses `marshmallow.Schema.Meta.render_module` to deserialize
the passed string before passing data to :meth:`load`.

:param json_data: A string of the data to deserialize.
:param many: Whether to deserialize `obj` as a collection. If `None`, the
    value for `self.many` is used.
:param partial: Whether to ignore missing fields and not require
    any fields declared. Propagates down to ``Nested`` fields as well. If
    its value is an iterable, only missing fields listed in that iterable
    will be ignored. Use dot delimiters to specify nested fields.
:param unknown: Whether to exclude, include, or raise an error for unknown
    fields in the data. Use `EXCLUDE`, `INCLUDE` or `RAISE`.
    If `None`, the value for `self.unknown` is used.
:return: Deserialized data

.. versionadded:: 1.0.0
.. versionchanged:: 3.0.0b7
    This method returns the deserialized data rather than a ``(data, errors)`` duple.
    A :exc:`ValidationError <marshmallow.exceptions.ValidationError>` is raised
    if invalid data are passed.
r  )rD   r   loadsr  )r   	json_datari   r   r   rj   r   s          r)   r  Schema.loads  s6    < yy&&,,YA&Ayy'yKKr>   c                   U(       a  U" X#XeS9  g U" X&US9  g ! [          a  n	U	R                  n
U
[        :X  a  [        nOfS n U R                  U
   nO.! [         a!    XR
                  ;   a  U R
                  U
   n Of = fU(       a  UR                  b  UR                  OU
nOU
nUR                  U	R                  XS9   S n	A	g S n	A	ff = f)N)r   ri   r   )	r   r'   r   r   rn   r   r   r   r   )r   validator_funcoutputr   r   ri   r   pass_originalr   errr'   r   r   s                r)   _run_validatorSchema._run_validator=  s    	IvgQvTB 	IJV#!*.	E $J 7I E!%9%99$($8$8$D	E  %--9 "**'   *H##CLL(#H)	Is=     
C
CAC(A>;C=A>>ACC
ri   r   c                    U R                  XUSS9  0 $ ! [         aC  n[        R                  " [        [
        [        [
           4   UR                  5      s SnA$ SnAff = f)a<  Validate `data` against the schema, returning a dictionary of
validation errors.

:param data: The data to validate.
:param many: Whether to validate `data` as a collection. If `None`, the
    value for `self.many` is used.
:param partial: Whether to ignore missing fields and not require
    any fields declared. Propagates down to ``Nested`` fields as well. If
    its value is an iterable, only missing fields listed in that iterable
    will be ignored. Use dot delimiters to specify nested fields.
:return: A dictionary of validation errors.

.. versionadded:: 1.1.0
F)ri   r   r  N)r  r   r   r   rS   ry   rP   r   )r   r   ri   r   excs        r)   validateSchema.validated  sW    0	CMM$7MN 	  	C;;tCcN3S\\BB	Cs    
A"8AA"A"Tr  c          
        [        5       n0 nUc  U R                  O
[        U5      nUc  U R                  O
[	        U5      nUc  U R
                  nU R                  [           (       a   U R                  [        XXS9nOUnU(       d  U R                  WUUUUS9n
U R                  XjUS9  U R                  [           (       a?  [        UR                  5      nU R                  USU
UUUUS9  U R                  USU
UUUUS9  UR                  nU(       d7  U(       a0  U R                  [            (       a   U R                  [         U
UUUS9n
U(       a  [        XqW
S9nU R#                  XX#S	9  UeW
$ ! [         a  n	U	R                  5       nSn
 Sn	A	GNSn	A	ff = f! [         a  n	U	R                  5       n Sn	A	NnSn	A	ff = f)
a  Deserialize `data`, returning the deserialized result.
This method is private API.

:param data: The data to deserialize.
:param many: Whether to deserialize `data` as a collection. If `None`, the
    value for `self.many` is used.
:param partial: Whether to validate required fields. If its
    value is an iterable, only fields listed in that iterable will be
    ignored will be allowed missing. If `True`, all fields will be allowed missing.
    If `None`, the value for `self.partial` is used.
:param unknown: Whether to exclude, include, or raise an error for unknown
    fields in the data. Use `EXCLUDE`, `INCLUDE` or `RAISE`.
    If `None`, the value for `self.unknown` is used.
:param postprocess: Whether to run post_load methods..
:return: Deserialized data
N)ri   r   r   )r   ri   r   r   )r   r   ri   T)r   	pass_manyr   r   ri   r   field_errorsF)r   r   r  )r   ri   r   r   r    r   rd   r   _invoke_load_processorsr   normalized_messagesr   _invoke_field_validatorsr   errors_invoke_schema_validatorsr   r   )r   r   ri   r   r   r  r   r*  processed_datar  r   r&  r!  s                r)   r  Schema._do_load  s   8 !l') Ltyyd4j  LL1': 	
 ?llG;;x 2!%!=!=dT "> " "N&&' ' F ))'4 *  {{+,#K$6$67.. +""&#!- /  .. +#"&#!- /  !''Fkdkk).D	7!99!!&* ' : F !&GCcdDIs # 2002-12d ' 7 446F7s0   )E1 5F 1
F;FF
F?%F::F?c           	        U R                   b`  U R                  SU R                   S5        U R                  U R                    Vs/ s H  oR                  SS5      S   PM     sn5      U l         U R                  (       aW  U R                  SU R                  S5        U R                  U R                   Vs/ s H  nSU;  d  M  UPM     sn5      U l        ggs  snf s  snf )	zFApply then flatten nested schema options.
This method is private API.
Nr   intersectionr      r   r   union)r   _Schema__apply_nested_option	set_classsplitr   )r   fields     r)   r    Schema._normalize_nested_options  s     99 &&vtyy.IDII'VI5C(;A(>I'VWDI<<&&y$,,H>>$(LLEL5Cu4DLEDL	  (W Fs   C5
CCc                   U Vs/ s H  nSU;   d  M  UR                  SS5      PM     nn[        [        5      nU H  u  pxXg   R                  U5        M     [	        UR                  5       5       H  u  pU R                  U
5      n[        U R                  U	   US5      nU(       a2  US:X  a  XR                  U5      -  nUS:X  a  XR                  U5      -  n[        U R                  U	   X5        M     gs  snf )z%Apply nested options to nested fieldsr   r0  r]   r1  r/  N)
r4  r   rP   appenditerr$   r3  r/   r   setattr)r   option_namefield_namesset_operationrU   nested_fieldsnested_optionsrs   nested_namesr   optionsnew_optionsoriginal_optionss                r)   __apply_nested_optionSchema.__apply_nested_option  s     9DSsd{+C+S$T*$1 F")),7 %2 !!5!5!78LC..1K&t';';C'@+rR G+>>2B#CCK N2>>2B#CCKD((-{H 9 Ts
   
C8C8c                   U R                   R                  (       a&  U R                  U R                   R                  5      nOkU R                  U R                  R	                  5       5      nU R                   R
                  (       a'  XR                  U R                   R
                  5      -  nU R                  5       nU R                  b#  U R                  U R                  5      nX#U-
  -  nOUnU R                  (       a  X0R                  -
  nX R                  U-
  -  nU(       a  SU  SU S3n[        U5      eU R                  5       nU HG  nU R                  R                  U[        R                  " 5       5      nU R                  Xg5        XuU'   MI     U R                  5       U R                  5       pUR                  5        H1  u  pgUR                  (       d  XxU'   UR                   (       a  M-  XyU'   M3     U	R                  5        V
Vs/ s H   u  pUR"                  b  UR"                  OU
PM"     nn
n[%        U5      [%        ['        U5      5      :w  a?  U Vs1 s H  oR)                  U5      S:  d  M  UiM     nn[        S[+        U5       35      eUR                  5        V
Vs/ s H  u  pUR,                  =(       d    U
PM     nn
n[%        U5      [%        ['        U5      5      :w  a?  U Vs1 s H  oR)                  U5      S:  d  M  UiM     nn[        S[+        U5       35      eXPl        Xl        Xl        gs  snn
f s  snf s  snn
f s  snf )zpUpdate self.fields, self.load_fields, and self.dump_fields based on schema options.
This method is private API.
NzInvalid fields for z: r   r0  zThe data_key argument for one or more fields collides with another field's name or data_key argument. Check the following field names and data_key arguments: zThe attribute argument for one or more fields collides with another field's name or attribute argument. Check the following field names and attribute arguments: )rD   r   r3  r   keysr   r   r   r   r   rL   	ma_fieldsInferred_bind_fieldr$   r   r   r   r   r   countrP   r  r   r   )r   available_field_namesinvalid_fieldsr<  messagefields_dictr'   r   r   r   rU   dump_data_keysxdata_keys_duplicatesr   load_attributesattributes_duplicatess                    r)   r   Schema._init_fields  s    99$(NN4993C3C$D!$(NN43G3G3L3L3N$O!yy##%		8L8L)MM%)99 :>..:SK,AAAN/K << &4Kll-BBBN+D6N3C1EGW%%oo'%J,,00Y=O=O=QRIZ3&/
# &
 $(??#4doo6G[%0%6%6%8!J&&*3J'&&&*3J'	 &9 $/#4#4#6
#6 #,"4"4"@IdJ#6 	 
 ~#c.&9"::)$)a-A-A!-Dq-H> ! $ ' (,,@'A&BD  CNBSBSBUVBUYT3==0D0BUV3s?';#<<*%*a.C.CA.F.J? " % ( )--B(C'DF  "&&9

$ W%s$   'MM9M+!M4MMc                    g)zaHook to modify a field when it is bound to the `Schema <marshmallow.Schema>`.

No-op by default.
Nr]   )r   r'   r   s      r)   on_bind_fieldSchema.on_bind_fieldZ  s    
 	r>   c                n   XR                   ;   a  SUl         XR                  ;   a  SUl         UR                  X5        U R                  X5        g! [         aY  n[	        U[
        5      (       a>  [        U[        R                  5      (       a  SU SUR                   S3n[        U5      Uee SnAff = f)zBind field to the schema, setting any necessary attributes on the
field (e.g. parent and name).

Also set field load_only and dump_only values if field_name was
specified in `class Meta <marshmallow.Schema.Meta>`.
TzField for "zJ" must be declared as a Field instance, not a class. Did you mean "fields.z()"?N)r   r   _bind_to_schema	TypeErrorr   rA   
issubclassr	   r%   r~   rW  )r   r'   r   r   msgs        r)   rJ  Schema._bind_fielda  s     '"&I'"&I	%%j7 	:1  	 )T**z)T]]/S/S!* .,,5,>,>+?tE 
  n%/	s   A 
B4AB//B4)r   c               J    U R                  USX#US9nU R                  USX#US9$ )NF)r%  r   ri   r   T_invoke_processors)r   rv   r   ri   r   s        r)   r   Schema._invoke_dump_processors|  sE     &&5tm ' 
 &&4d] ' 
 	
r>   c          	     R    U R                  USUUUUS9nU R                  USUUUUS9$ )NT)r%  r   ri   r   r   Fr`  )r   rv   r   ri   r   r   s         r)   r'  Schema._invoke_load_processors  sW     &&' ' 
 &&' ' 
 	
r>   c          
        U R                   [            GH  u  pEn[        X5      nUS   n U R                  U   n	U	R                  b  U	R                  OUnU(       a{  [        U5       Hj  u  p XR                  =(       d    U   nU R                  UUUUU R                  R                  (       a  UOS S9nU[        L a  UR                  US 5        Mj  Ml     M   X)R                  =(       d    U   nU R                  UUUUS9nU[        L a  UR                  US 5        GM  GM     g ! [         a+  n
XR
                  ;   a   S n
A
GM2  [        SU S35      U
eS n
A
ff = f! [         a     GM  f = f! [         a     GMj  f = f)Nr'   "z" field does not exist.r   )r   r   r'   r   )rd   r   r/   r   rn   r   r   r   r   r  r   rD   r   r   pop)r   r   r   ri   rk   rY   validator_kwargs	validatorr'   r   r   r   r  itemr   validated_values                   r)   r)  Schema._invoke_field_validators  s   .2kk).D*I*0I),7JU KK
3	 '0&8&8&D	""*  !*4IC7 $%8%8%FJ G +/*>*>(1!&'/(3*.))*@*@3d +? + +g5 HHZ6 6 "1 3 !4!4!B
CE '+&:&:$-"#+$/	 '; 'O ''1T2 2U /E  U!5!55 1ZL0G!HIuTU $    sA   D&.EE0&
E0EEE
E-,E-0
E?>E?)r&  c               b   U R                   [            H  u  pn
X:w  a  M  [        X5      nU(       a  U
S   (       a  M+  U
R                  SS5      nU(       a?  U(       d8  [	        [        X45      5       H  u  nu  pU R                  UUUUUUUUS9  M      M  U R                  UUUUUUUS9  M     g )Nskip_on_field_errorsr  F)r   r   ri   r   r   r  )r   r   ri   r  r   )rd   r   r/   rL   r   zipr  )r   r   r%  r   r   ri   r   r&  rk   	hook_manyrh  ri  r  r  rj  origs                   r)   r+   Schema._invoke_schema_validators  s     7;kkBR6S2I"2%0I 01G H,00%HMI)23t3K)L%C$''!&*$/! '!&3 ( 	 *M ##"/ +"/# $ + 7Tr>   c          
        U R                   U    H  u  pxn	X:w  a  M  [        X5      n
U	R                  SS5      nU(       aT  U(       dM  U(       a*  [        X55       VVs/ s H  u  pU
" X4SU0UD6PM     nnnMi  U Vs/ s H  o" U4SU0UD6PM     nnM  U(       a  U
" X54SU0UD6nM  U
" U4SU0UD6nM     U$ s  snnf s  snf )Nr  Fri   )rd   r/   rL   r   )r   rv   r%  r   ri   r   rj   rk   rp  processor_kwargs	processorr  rj  originals                 r)   ra  Schema._invoke_processors  s     7;kk#6F2I"2%0I,00%HMI  /:$.N.NND "$FtFvF.N  D
 NRRTTId@@@TDRD J4J6J ;D;F;% 7G& 
 Ss   B:=C )r   r   r   r   r   r   r   r   r   ri   r   rH   r   r   )r   ztypes.StrSequenceOrSet | Noner   types.StrSequenceOrSetri   bool | Noner   zdict | Noner   rx  r   rx  r   $bool | types.StrSequenceOrSet | Noner   
str | None)rz   ry   )rz   r|   )r   rF   rU   ry   rz   ztype[Schema])r   r   r   rC   ri   r   )r   rC   rt   ry   r   rC   )r   rC   ri   r   )r   rC   ri   ry  )r   Rtyping.Mapping[str, typing.Any] | typing.Iterable[typing.Mapping[str, typing.Any]]r   r   ri   r   rz   ztyping.Any | list[typing.Any])r   r|  ri   ry  r   rz  r   r{  )r  zstr | bytes | bytearrayri   ry  r   rz  r   r{  )r  ztypes.SchemaValidatorr   r   ri   r   r   rz  r  r   r   z
int | None)r   r|  ri   ry  r   rz  rz   zdict[str, list[str]])
r   r|  ri   ry  r   rz  r   r{  r  r   )rz   None)r'   ry   r   r"   rz   r}  )rv   ry   ri   r   )rv   ry   ri   r   r   rz  )r   r   ri   r   )
r   r   r%  r   ri   r   r   rz  r&  r   )rv   ry   r%  r   ri   r   )Jr~   r   r   r   r   ry   rH  StringbytesdtdatetimeDateTimefloatFloatr   Booleanr   RawrP   r   intIntegeruuidUUIDtimeTimedateDate	timedelta	TimeDeltadecimalDecimalr   r   r   r   r   rE   r   r3  r.   rd   rB   ra   r   propertyr   r   r   r   r   staticmethodr   r   r   r   r   r   r  r  r  r"  r  r   r2  r   rW  rJ  r   r'  r)  r+  ra  r   r]   r>   r)   r   r     s   2j 	Yy
Y''yiy}}immY]]Y		9>>


i))**-L) " &(NN' &#/^ 
 %M4$I )+&+68F38Y Y| /3*, #,.,.8<"4' ,4' (	4'
 4' 4' *4' *4' 64' 4'l@   
 &	C C 	C
 
C C@$,6AE- MQ  & ;@ $ <@  D AE J2 p?p  p p 
'pr !8<"!
?!
 !
 6!
 !
N !8<"L*L 	L
 6L LV !%I-%I  %I %I 6%I %I %I\ !8<?  6 
N !8<" e?e e 6e e eN"I&I'V28 <@

'+



 
 6
8,3n #(  ( 	( ( 6( (b  	  r>   r   )	metaclass)rz   r{   )r;   r+   )Br   
__future__r   r   r  r  r  r7   r5   r   r9   r   r  r   abcr   collectionsr   r   collections.abcr   	itertoolsr   marshmallowr	   r
   r   r   rH  marshmallow.decoratorsr   r   r   r   r   r   marshmallow.error_storer   marshmallow.exceptionsr   r   r   marshmallow.orderedsetr   marshmallow.utilsr   r   r   r   r   r   r   r   r    marshmallow.warningsr!   TYPE_CHECKINGmarshmallow.fieldsr"   r*   r=   r+   r   	SchemaABCr   
BaseSchemar]   r>   r)   <module>r     s    | "            0 # ! 3 3 +  / T T -
 
 
 >	(	.z zz-1 -1`VT^^z Vr  
r>   