
    Ng                     6    d Z ddlmZ  G d d          Zd ZdS )zUtilities for storing collections of error messages.

.. warning::

    This module is treated as private API.
    Users should not need to use this module directly.
    )SCHEMAc                        e Zd Zd ZedfdZdS )
ErrorStorec                     i | _         d S N)errors)selfs    S/var/www/html/ai-engine/env/lib/python3.11/site-packages/marshmallow/error_store.py__init__zErrorStore.__init__   s        Nc                     |t           k    st          |t                    s||i}|||i}t          | j        |          | _        d S r   )r   
isinstancedictmerge_errorsr   )r	   messages
field_nameindexs       r
   store_errorzErrorStore.store_error   sO     z(D'A'A"H-Hx(H"4;99r   )__name__
__module____qualname__r   r   r    r   r
   r   r      s>           06T : : : : : :r   r   c                    | s|S |s| S t          | t                    rot          |t                    r| |z   S t          |t                    r:t          |fi t          t	          | |                    t                              iS | |gz   S t          | t                    rt          |t                    r:t          | fi t          t	          |                     t                    |          iS t          |t                    rNt          |           }|                                D ](\  }}||v rt	          ||         |          ||<   #|||<   )|S t          | fi t          t	          |                     t                    |          iS t          |t                    r| g|z   S t          |t                    r:t          |fi t          t	          | |                    t                              iS | |gS )zDeeply merge two error messages.

    The format of ``errors1`` and ``errors2`` matches the ``message``
    parameter of :exc:`marshmallow.exceptions.ValidationError`.
    )r   listr   r   r   getitems)errors1errors2r   keyvals        r
   r   r      s      '4   #gt$$ 	%W$$gt$$ 	YXXFL'++fBUBU,V,V#WXXX'""'4   Ugt$$ 	YXXFLV9L9Lg,V,V#WXXXgt$$ 	']]F#MMOO & &S&==".vc{C"@"@F3KK"%F3KKMGTTW[[5H5H'(R(RSTTT'4   #y7""'4   UGTTWgkk&>Q>Q(R(RSTTTWr   N)__doc__marshmallow.exceptionsr   r   r   r   r   r
   <module>r#      sd     * ) ) ) ) ): : : : : : : :          r   