
    E
i	                     <    d Z ddlmZ  G d d          Z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    C:\Users\Dell Inspiron 16\Desktop\tws\AgrotaPowerBi\back-agrota-powerbi\mcp-client-agrota\venv\Lib\site-packages\marshmallow/error_store.py__init__zErrorStore.__init__   s        Nc                     t          |          }|t          k    st          |t                    s||i}|||i}t	          | j        |          | _        d S r   )copy_containersr   
isinstancedictmerge_errorsr	   )r
   messages
field_nameindexs       r   store_errorzErrorStore.store_error   s\     #8,,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                     t          | t                    rd | D             S t          | t                    rd |                                 D             S | S )Nc                 ,    g | ]}t          |          S r   r   ).0vals     r   
<listcomp>z#copy_containers.<locals>.<listcomp>   s     777$$777r   c                 4    i | ]\  }}|t          |          S r   r   )r   keyr   s      r   
<dictcomp>z#copy_containers.<locals>.<dictcomp>!   s&    IIIhc3_S))IIIr   )r   listr   itemsr   s    r   r   r      s\    &$ 8777777&$ JII&,,..IIIIMr   c                 P   | s|S |s| S t          | t                    rt          |t                    r|                     |           | S t          |t                    r2t	          | |                    t                              |t          <   |S |                     |           | S t          | t                    rt          |t                    r?|                                D ](\  }}|| v rt	          | |         |          | |<   #|| |<   )| S t	          |                     t                    |          | t          <   | S t          |t                    r| g|S t          |t                    r2t	          | |                    t                              |t          <   |S | |gS )zDeeply merge two error messages.

    The format of ``errors1`` and ``errors2`` matches the ``message``
    parameter of :exc:`marshmallow.exceptions.ValidationError`.
    )	r   r$   extendr   r   getr   appendr%   )errors1errors2r"   r   s       r   r   r   %   s      '4   gt$$ 	NN7###Ngt$$ 	*7GKK4G4GHHGFONw'4   	gt$$ 	#MMOO ' 'S'>>#/c#B#BGCLL#&GCLLN&w{{6':':GDD'4   #"'""'4   &wF0C0CDDWr   N)__doc__marshmallow.exceptionsr   r   r   r   r   r   r   <module>r.      ss     * ) ) ) ) ): : : : : : : :"  " " " " "r   