§
    ÇÁ³gF  ã                  ó¨  — U d Z ddlmZ ddlmZmZmZ ddlZerddl	m
Z
 	 ddlZddlmZ ddlmZmZ ddlmZmZmZ dd	lmZ eegef         ZdZd
ed<   n# e$ rZeZY dZ[ndZ[ww xY wg Zded<   d.d„Zd/d„Zd0d„Z e¦   «         Z ded<    e¦   «         Z!ded<    e¦   «         Z"ded<   d1d„Z#ese€d2d „Z$d3d'„Z% G d(„ d)e¦  «        Z&d4d,„Z'dS d4d-„Z'dS )5a  A mypy_ plugin for managing a number of platform-specific annotations.
Its functionality can be split into three distinct parts:

* Assigning the (platform-dependent) precisions of certain `~numpy.number`
  subclasses, including the likes of `~numpy.int_`, `~numpy.intp` and
  `~numpy.longlong`. See the documentation on
  :ref:`scalar types <arrays.scalars.built-in>` for a comprehensive overview
  of the affected classes. Without the plugin the precision of all relevant
  classes will be inferred as `~typing.Any`.
* Removing all extended-precision `~numpy.number` subclasses that are
  unavailable for the platform in question. Most notably this includes the
  likes of `~numpy.float128` and `~numpy.complex256`. Without the plugin *all*
  extended-precision types will, as far as mypy is concerned, be available
  to all platforms.
* Assigning the (platform-dependent) precision of `~numpy.ctypeslib.c_intp`.
  Without the plugin the type will default to `ctypes.c_int64`.

  .. versionadded:: 1.22

Examples
--------
To enable the plugin, one must add it to their mypy `configuration file`_:

.. code-block:: ini

    [mypy]
    plugins = numpy.typing.mypy_plugin

.. _mypy: https://mypy-lang.org/
.. _configuration file: https://mypy.readthedocs.io/en/stable/config_file.html

é    )Úannotations)ÚFinalÚTYPE_CHECKINGÚCallableN)ÚIterable)ÚType)ÚPluginÚAnalyzeTypeContext)ÚMypyFileÚ
ImportFromÚ	Statement)ÚPRI_MEDzNone | ModuleNotFoundErrorÚMYPY_EXú	list[str]Ú__all__Úreturnúdict[str, str]c                 óŽ  — dt           j        fdt           j        fdt           j        fdt           j        fdt           j        fdt           j        fdt           j        fdt           j        fd	t           j	        fd
t           j
        fdt           j        fg} i }d}| D ],\  }}d |¦   «         j        j        z  }|› d|› d�||› d|› �<   Œ-|S )NÚ	_NBitByteÚ
_NBitShortÚ	_NBitIntCÚ	_NBitIntPÚ_NBitIntÚ	_NBitLongÚ_NBitLongLongÚ	_NBitHalfÚ_NBitSingleÚ_NBitDoubleÚ_NBitLongDoubleznumpy._typingé   z._nbit_base._ÚBitz._nbit.)ÚnpÚbyteÚshortÚintcÚintpÚint_ÚlongÚlonglongÚhalfÚsingleÚdoubleÚ
longdoubleÚdtypeÚitemsize)ÚnamesÚretÚmoduleÚnameÚtypÚns         úV/var/www/html/mpstechhub/venv/lib/python3.11/site-packages/numpy/typing/mypy_plugin.pyÚ_get_precision_dictr7   :   sÞ   € à	•b”gÐØ	•r”xÐ Ø	•b”gÐØ	•b”gÐØ	•R”WÐØ	•b”gÐØ	�"œ+Ð&à	•b”gÐØ	�œ	Ð"Ø	�œ	Ð"Ø	�BœMÐ*ð€Eð €CØ€FØð Gð G‰	ˆˆcØ�S�S‘U”U”[Ô)Ñ)ˆØ+1Ð(FÐ(FÀÐ(FÐ(FÐ(FˆˆvÐ$Ð$˜dÐ$Ð$Ñ%Ð%Ø€Jó    c                 ó"   — g d¢} d„ | D ¦   «         S )N)Úuint128Úuint256Úint128Úint256Úfloat80Úfloat96Úfloat128Úfloat256Ú
complex160Ú
complex192Ú
complex256Ú
complex512c                ó<   — g | ]}t          t          |¦  «        ¯|‘ŒS © )Úhasattrr"   )Ú.0Úis     r6   ú
<listcomp>z0_get_extended_precision_list.<locals>.<listcomp>`   s%   € Ð8Ð8Ð8�!­µ°Q©¬Ð8ˆAÐ8Ð8Ð8r8   rG   )Úextended_namess    r6   Ú_get_extended_precision_listrM   Q   s)   € ðð ð €Nð 9Ð8�~Ð8Ñ8Ô8Ð8r8   Ústrc                 óh   — t          j        d¦  «        j        } | dk    rdS | dk    rdS | dk    rdS dS )Nr5   rJ   Úc_intÚlÚc_longÚqÚ
c_longlong)r"   r.   Úchar)rU   s    r6   Ú_get_c_intp_namerV   b   sA   € åŒ8�C‰=Œ=Ô€DØˆs‚{€{ØˆwØ	�ŠˆØˆxØ	�ŠˆØˆ|àˆxr8   r   Ú_PRECISION_DICTÚ_EXTENDED_PRECISION_LISTÚ_C_INTPÚctxr
   r   c                ó˜   — | \  }}}|j                              d¦  «        d         }t          d|› �         }|                     |¦  «        S )z;Replace a type-alias with a concrete ``NBitBase`` subclass.ú.éÿÿÿÿznumpy._typing._nbit.)r3   ÚsplitrW   Ú
named_type)rZ   r4   Ú_Úapir3   Úname_news         r6   Ú_hookrc   z   sJ   € à�K€CˆˆCØŒ8�>Š>˜#ÑÔ˜rÔ"€DÝÐ<°dÐ<Ð<Ô=€HØ�>Š>˜(Ñ#Ô#Ð#r8   ÚiterableúIterable[Statement]ÚidÚintc                ó‚   — t          | ¦  «        D ]\  }}t          |dd¦  «        |k    r|c S Œt          d|›�¦  «        ‚)z>Identify the first ``ImportFrom`` instance the specified `id`.rf   NzBFailed to identify a `ImportFrom` instance with the following id: )Ú	enumerateÚgetattrÚ
ValueError)rd   rf   rJ   Úvalues       r6   Ú_indexrm   ƒ   sf   € å! (Ñ+Ô+ð 	ð 	‰HˆAˆuÝ�u˜d DÑ)Ô)¨RÒ/Ð/Ø���ð 0åð :Ø35ð:ð :ñ ;ô ;ð 	;r8   Úfiler   r2   Úimportsúlist[tuple[str, None | str]]ÚNonec                ó„   — t          |d|¬¦  «        }d|_        | j        | j        fD ]}t	          ||¦  «        }|||<   ŒdS )z<Override the first `module`-based import with new `imports`.r   )r0   TN)r   Úis_top_levelÚdefsro   rm   )rn   r2   ro   Ú
import_objÚlstrJ   s         r6   Ú_override_importsrw   ‹   s^   € õ   ¨°Ð9Ñ9Ô9ˆ
Ø"&ˆ
Ôð ”I˜tœ|Ð,ð 	 ð 	 ˆCÝ�s˜FÑ#Ô#ˆAØˆC�‰FˆFð	 ð 	 r8   c                  ó"   — e Zd ZdZdd„Zdd
„ZdS )Ú_NumpyPluginz>A mypy plugin for handling versus numpy-specific typing tasks.ÚfullnamerN   r   úNone | _HookFuncc                ó&   — |t           v rt          S dS )z«Set the precision of platform-specific `numpy.number`
            subclasses.

            For example: `numpy.int_`, `numpy.longlong` and `numpy.longdouble`.
            N)rW   rc   )Úselfrz   s     r6   Úget_type_analyze_hookz"_NumpyPlugin.get_type_analyze_hook�   s   € ð �?Ð*Ð*Ý�Ø�4r8   rn   r   úlist[tuple[int, str, int]]c                óÊ   — t           |j        dfg}|j        dk    r"t          |dd„ t          D ¦   «         ¬¦  «         n%|j        dk    rt          |dt          dfg¬¦  «         |S )	a.  Handle all import-based overrides.

            * Import platform-specific extended-precision `numpy.number`
              subclasses (*e.g.* `numpy.float96`, `numpy.float128` and
              `numpy.complex256`).
            * Import the appropriate `ctypes` equivalent to `numpy.intp`.

            r]   Únumpyz!numpy._typing._extended_precisionc                ó   — g | ]}||f‘ŒS rG   rG   )rI   Úvs     r6   rK   z4_NumpyPlugin.get_additional_deps.<locals>.<listcomp>·   s   € ÐFÐFÐF¨˜a ˜VÐFÐFÐFr8   )ro   znumpy.ctypeslibÚctypesÚ_c_intp)r   rz   rw   rX   rY   )r}   rn   r1   s      r6   Úget_additional_depsz _NumpyPlugin.get_additional_deps§   s”   € õ ˜Tœ]¨BÐ/Ð0ˆCàŒ} Ò'Ð'Ý!ØÐ=ØFÐFÕ-EÐFÑFÔFðñ ô ð ð ð ”Ð"3Ò3Ð3Ý!Ø˜(Ý% yÐ1Ð2ðñ ô ð ð ˆJr8   N)rz   rN   r   r{   )rn   r   r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r~   r†   rG   r8   r6   ry   ry   š   sB   € € € € € ØLÐLð	ð 	ð 	ð 	ð	ð 	ð 	ð 	ð 	ð 	r8   ry   Úversionútype[_NumpyPlugin]c                ó   — t           S ©zAn entry-point for mypy.)ry   ©r‹   s    r6   Úpluginr�   À   s   € åÐr8   c                ó   — t           ‚rŽ   )r   r�   s    r6   r�   r�   Å   s   € åˆr8   )r   r   )r   r   )r   rN   )rZ   r
   r   r   )rd   re   rf   rN   r   rg   )rn   r   r2   rN   ro   rp   r   rq   )r‹   rN   r   rŒ   )(rŠ   Ú
__future__r   Útypingr   r   r   r�   r"   Úcollections.abcr   Ú
mypy.typesÚmypyr   Úmypy.pluginr	   r
   Ú
mypy.nodesr   r   r   Ú
mypy.buildr   Ú	_HookFuncr   Ú__annotations__ÚModuleNotFoundErrorÚexr   r7   rM   rV   rW   rX   rY   rc   rm   rw   ry   r�   rG   r8   r6   ú<module>rž      sƒ  ððð ð ðB #Ð "Ð "Ð "Ð "Ð "à 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1à Ð Ð Ð àð )Ø(Ð(Ð(Ð(Ð(Ð(ð
ØÐÐÐØÐÐÐÐÐØ6Ð6Ð6Ð6Ð6Ð6Ð6Ð6Ø:Ð:Ð:Ð:Ð:Ð:Ð:Ð:Ð:Ð:Ø"Ð"Ð"Ð"Ð"Ð"àÐ,Ð-¨tÐ3Ô4€IØ*.€GÐ.Ð.Ð.Ñ.Ð.øØð ð ð Ø€G€G€G€G€G€Gøøøøðøøøð €Ð Ð Ð Ñ ðð ð ð ð.9ð 9ð 9ð 9ð"
ð 
ð 
ð 
ð -Ð,Ñ.Ô.€Ð .Ð .Ð .Ñ .ð #?Ð">Ñ"@Ô"@Ð Ð @Ð @Ð @Ñ @ð "Ð!Ñ#Ô#€Ð #Ð #Ð #Ñ #ð$ð $ð $ð $ð ð E�G�Oð;ð ;ð ;ð ;ð ð  ð  ð  ð$ð $ð $ð $ð $�vñ $ô $ð $ðLð ð ð ð ð ð
ð ð ð ð ð s   ¡4A ÁA'ÁA"Á"A'