§
    µ¯¸j  ã                   óF  — d Z ddlmZ d„ Zd„ Z G d„ de¦  «        Ze G d„ de¦  «        ¦   «         Ze G d	„ d
e¦  «        ¦   «         Ze G d„ de¦  «        ¦   «         Z	e G d„ de	¦  «        ¦   «         Z
e G d„ de	¦  «        ¦   «         Ze G d„ de¦  «        ¦   «         ZdS )zÚ
Various richly-typed exceptions, that also help us deal with string formatting
in python where it's easier.

By putting the formatting in `__str__`, we also avoid paying the cost for
users who silence the exceptions.
é   )Ú
set_modulec                 ó<   — t          | ¦  «        dk    r| d         S | S )Né   é    )Úlen)Útups    úf/root/private/project/pallet_detection_v2/.venv/lib/python3.11/site-packages/numpy/core/_exceptions.pyÚ_unpack_tupler
   
   s   € Ý
ˆ3�x„x�1‚}€}Ø�1Œvˆàˆ
ó    c                 ó(   — | j         j        | _        | S )aG  
    A decorator that makes an exception class look like its base.

    We use this to hide subclasses that are implementation details - the user
    should catch the base type, which is what the traceback will show them.

    Classes decorated with this decorator are subject to removal without a
    deprecation warning.
    )Ú__base__Ú__name__)Úclss    r	   Ú_display_as_baser      s   € ð ”<Ô(€C„LØ€Jr   c                   ó   — e Zd ZdZd„ ZdS )ÚUFuncTypeErrorz% Base class for all ufunc exceptions c                 ó   — || _         d S ©N)Úufunc)Úselfr   s     r	   Ú__init__zUFuncTypeError.__init__"   s   € ØˆŒ
ˆ
ˆ
r   N)r   Ú
__module__Ú__qualname__Ú__doc__r   © r   r	   r   r       s)   € € € € € Ø/Ð/ðð ð ð ð r   r   c                   ó(   ‡ — e Zd ZdZˆ fd„Zd„ Zˆ xZS )Ú_UFuncNoLoopErrorz* Thrown when a ufunc loop cannot be found c                 ór   •— t          ¦   «                              |¦  «         t          |¦  «        | _        d S r   )Úsuperr   ÚtupleÚdtypes©r   r   r!   Ú	__class__s      €r	   r   z_UFuncNoLoopError.__init__)   s,   ø€ Ý‰Œ×Ò˜ÑÔÐÝ˜F‘m”mˆŒˆˆr   c           	      óÔ   — d                      | j        j        t          | j        d | j        j        …         ¦  «        t          | j        | j        j        d …         ¦  «        ¦  «        S )NzLufunc {!r} did not contain a loop with signature matching types {!r} -> {!r})Úformatr   r   r
   r!   Únin©r   s    r	   Ú__str__z_UFuncNoLoopError.__str__-   sW   € ðç
Š&ØŒJÔÝ˜$œ+ o t¤z¤~ oÔ6Ñ7Ô7Ý˜$œ+ d¤j¤n o oÔ6Ñ7Ô7ñ
ô 
ð	
r   ©r   r   r   r   r   r(   Ú__classcell__©r#   s   @r	   r   r   &   sM   ø€ € € € € à4Ð4ð$ð $ð $ð $ð $ð
ð 
ð 
ð 
ð 
ð 
ð 
r   r   c                   ó(   ‡ — e Zd ZdZˆ fd„Zd„ Zˆ xZS )Ú_UFuncBinaryResolutionErrorz' Thrown when a binary resolution fails c                 óL   •— t          ¦   «                              ||¦  «         d S r   )r   r   r"   s      €r	   r   z$_UFuncBinaryResolutionError.__init__;   s#   ø€ Ý‰Œ×Ò˜ Ñ'Ô'Ð'Ð'Ð'r   c                 ó<   —  dj         | j        j        g| j        ¢R Ž S )Nz7ufunc {!r} cannot use operands with types {!r} and {!r})r%   r   r   r!   r'   s    r	   r(   z#_UFuncBinaryResolutionError.__str__?   s5   € ðØEÜ
ØŒJÔð
ð #'¤+ð
ð 
ð 
ð 	
r   r)   r+   s   @r	   r-   r-   8   sM   ø€ € € € € à1Ð1ð%ð %ð %ð %ð %ð
ð 
ð 
ð 
ð 
ð 
ð 
r   r-   c                   ó   ‡ — e Zd Zˆ fd„Zˆ xZS )Ú_UFuncCastingErrorc                 ót   •— t          ¦   «                              |¦  «         || _        || _        || _        d S r   )r   r   ÚcastingÚfrom_Úto)r   r   r3   r4   r5   r#   s        €r	   r   z_UFuncCastingError.__init__I   s4   ø€ Ý‰Œ×Ò˜ÑÔÐØˆŒØˆŒ
ØˆŒˆˆr   )r   r   r   r   r*   r+   s   @r	   r1   r1   G   s8   ø€ € € € € ðð ð ð ð ð ð ð ð r   r1   c                   ó(   ‡ — e Zd ZdZˆ fd„Zd„ Zˆ xZS )Ú_UFuncInputCastingErrorz, Thrown when a ufunc input cannot be casted c                 ó^   •— t          ¦   «                              ||||¦  «         || _        d S r   )r   r   Úin_i©r   r   r3   r4   r5   Úir#   s         €r	   r   z _UFuncInputCastingError.__init__S   s,   ø€ Ý‰Œ×Ò˜ ¨°Ñ3Ô3Ð3ØˆŒ	ˆ	ˆ	r   c                 ó¾   — | j         j        dk    rd                     | j        ¦  «        nd}d                     | j         j        || j        | j        | j        ¦  «        S )Nr   ú{} Ú zGCannot cast ufunc {!r} input {}from {!r} to {!r} with casting rule {!r})r   r&   r%   r9   r   r4   r5   r3   ©r   Úi_strs     r	   r(   z_UFuncInputCastingError.__str__W   sW   € à+/¬:¬>¸QÒ+>Ð+>�—’˜TœYÑ'Ô'Ð'ÀBˆðç
Š&ØŒJÔ ¨¬
°D´G¸T¼\ñ
ô 
ð	
r   r)   r+   s   @r	   r7   r7   P   sM   ø€ € € € € à6Ð6ðð ð ð ð ð
ð 
ð 
ð 
ð 
ð 
ð 
r   r7   c                   ó(   ‡ — e Zd ZdZˆ fd„Zd„ Zˆ xZS )Ú_UFuncOutputCastingErrorz- Thrown when a ufunc output cannot be casted c                 ó^   •— t          ¦   «                              ||||¦  «         || _        d S r   )r   r   Úout_ir:   s         €r	   r   z!_UFuncOutputCastingError.__init__e   s,   ø€ Ý‰Œ×Ò˜ ¨°Ñ3Ô3Ð3ØˆŒ
ˆ
ˆ
r   c                 ó¾   — | j         j        dk    rd                     | j        ¦  «        nd}d                     | j         j        || j        | j        | j        ¦  «        S )Nr   r=   r>   zHCannot cast ufunc {!r} output {}from {!r} to {!r} with casting rule {!r})r   Únoutr%   rD   r   r4   r5   r3   r?   s     r	   r(   z _UFuncOutputCastingError.__str__i   sW   € à,0¬J¬O¸qÒ,@Ð,@�—’˜TœZÑ(Ô(Ð(Àbˆðç
Š&ØŒJÔ ¨¬
°D´G¸T¼\ñ
ô 
ð	
r   r)   r+   s   @r	   rB   rB   b   sM   ø€ € € € € à7Ð7ðð ð ð ð ð
ð 
ð 
ð 
ð 
ð 
ð 
r   rB   c                   óJ   — e Zd ZdZd„ Zed„ ¦   «         Zed„ ¦   «         Zd„ Z	dS )Ú_ArrayMemoryErrorz) Thrown when an array cannot be allocatedc                 ó"   — || _         || _        d S r   )ÚshapeÚdtype)r   rJ   rK   s      r	   r   z_ArrayMemoryError.__init__w   s   € ØˆŒ
ØˆŒ
ˆ
ˆ
r   c                 ó<   — | j         j        }| j        D ]}||z  }Œ|S r   )rK   ÚitemsizerJ   )r   Ú	num_bytesÚdims      r	   Ú_total_sizez_ArrayMemoryError._total_size{   s/   € à”JÔ'ˆ	Ø”:ð 	ð 	ˆCØ˜ÑˆIˆIØÐr   c                 óè  — d}d}g d¢}t          |                      ¦   «         dz
  d¦  «        |z  }d||z  z  }| |z  }~t          |¦  «        |k    r
|dz  }||z  }|t          |¦  «        k    r"t          |¦  «        dz
  }|d||z
  |z  z  z  }|}||         }|dk    rd                     ||¦  «        S t          |¦  «        dk     rd                     ||¦  «        S d	                     ||¦  «        S )
z5 Convert a number of bytes into a binary size string é
   i   )ÚbytesÚKiBÚMiBÚGiBÚTiBÚPiBÚEiBr   r   z	{:.0f} {}iè  z
{:#.3g} {}z
{:#.0f} {})ÚmaxÚ
bit_lengthÚroundr   r%   )	rN   Ú	LOG2_STEPÚSTEPÚunitsÚunit_iÚunit_valÚn_unitsÚ
new_unit_iÚ	unit_names	            r	   Ú_size_to_stringz!_ArrayMemoryError._size_to_string‚   s&  € ð
 ˆ	ØˆØCÐCÐCˆå�Y×)Ò)Ñ+Ô+¨aÑ/°Ñ3Ô3°yÑ@ˆØ˜ )Ñ+Ñ,ˆØ˜hÑ&ˆØõ �‰>Œ>˜TÒ!Ð!Ø�a‰KˆFØ�t‰OˆGð •S˜‘Z”ZÒÐÝ˜U™œ a™ˆJØ�q˜f zÑ1°YÑ>Ñ?Ñ?ˆGØˆFà˜&”Mˆ	à�QŠ;ˆ;à×%Ò% g¨yÑ9Ô9Ð9Ý�7‰^Œ^˜dÒ"Ð"à×&Ò& w°	Ñ:Ô:Ð:ð  ×&Ò& w°	Ñ:Ô:Ð:r   c                 óx   — |                       | j        ¦  «        }d                     || j        | j        ¦  «        S )NzAUnable to allocate {} for an array with shape {} and data type {})re   rP   r%   rJ   rK   )r   Úsize_strs     r	   r(   z_ArrayMemoryError.__str__§   s5   € Ø×'Ò'¨Ô(8Ñ9Ô9ˆàOßŠV�H˜dœj¨$¬*Ñ5Ô5ð	
r   N)
r   r   r   r   r   ÚpropertyrP   Ústaticmethodre   r(   r   r   r	   rH   rH   t   so   € € € € € à3Ð3ðð ð ð ðð ñ „Xðð ð";ð ";ñ „\ð";ðH
ð 
ð 
ð 
ð 
r   rH   N)r   Ú_utilsr   r
   r   Ú	TypeErrorr   r   r-   r1   r7   rB   ÚMemoryErrorrH   r   r   r	   ú<module>rm      sÂ  ððð ð  Ð Ð Ð Ð Ð ðð ð ðð ð ðð ð ð ð �Yñ ô ð ð ð
ð 
ð 
ð 
ð 
˜ñ 
ô 
ñ Ôð
ð" ð
ð 
ð 
ð 
ð 
Ð"3ñ 
ô 
ñ Ôð
ð ðð ð ð ð ˜ñ ô ñ Ôðð ð
ð 
ð 
ð 
ð 
Ð0ñ 
ô 
ñ Ôð
ð" ð
ð 
ð 
ð 
ð 
Ð1ñ 
ô 
ñ Ôð
ð" ð7
ð 7
ð 7
ð 7
ð 7
˜ñ 7
ô 7
ñ Ôð7
ð 7
ð 7
r   