Ë
    7Š·j³  ã            
       ó  — U d Z ddlmZmZ ddlmZmZmZ ddlZ	g Z
ee   ed<   deeef   fd„Zdee   fd„Zdefd	„Zd
Zeed<    e«       Zeed<    e«       Zeed<    e«       Zeed<   	 erddlmZ ddlZddlmZ ddlmZmZmZ ddl m!Z!m"Z" ddd„ f­Z#de!dejH                  jJ                  fd„Z&dee   dede'fd„Z(dededee)eedz  f      ddfd„Z* G d„ de"«      Z+d ede,fd!„Z-y# e.$ rZ/d ede,fd"„Z-Y dZ/[/ydZ/[/ww xY w)#aK  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

.. deprecated:: 2.3
    The :mod:`numpy.typing.mypy_plugin` entry-point is deprecated in favor of
    platform-agnostic static type inference. Remove
    ``numpy.typing.mypy_plugin`` from the ``plugins`` section of your mypy
    configuration; if that surfaces new errors, please open an issue with a
    minimal reproducer.

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

é    )ÚCallableÚIterable)ÚTYPE_CHECKINGÚFinalÚcastNÚ__all__Úreturnc                  ó  — 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t        j                  |«      j                  z  }t        › d|› d�|t        › d|› �<   ŒA |S )NÚ	_NBitByteÚ
_NBitShortÚ	_NBitIntCÚ	_NBitIntPÚ_NBitIntÚ	_NBitLongÚ_NBitLongLongÚ	_NBitHalfÚ_NBitSingleÚ_NBitDoubleÚ_NBitLongDoubleé   z._nbit_base._ÚBitú._nbit.)ÚnpÚbyteÚshortÚintcÚintpÚint_ÚlongÚlonglongÚhalfÚsingleÚdoubleÚ
longdoubleÚdtypeÚitemsizeÚ_MODULE)ÚnamesÚretÚnameÚtypÚns        úN/root/workspace/.venv/lib/python3.12/site-packages/numpy/typing/mypy_plugin.pyÚ_get_precision_dictr.   1   sê   € à	”b—g‘gÐØ	”r—x‘xÐ Ø	”b—g‘gÐØ	”b—g‘gÐØ	”R—W‘WÐØ	”b—g‘gÐØ	œ"Ÿ+™+Ð&à	”b—g‘gÐØ	œŸ	™	Ð"Ø	œŸ	™	Ð"Ø	œBŸM™MÐ*ð€Eð €CØò I‰	ˆˆcØ”—‘˜“×&Ñ&Ñ&ˆÜ,3¨9°MÀ!ÀÀCÐ)HˆŒwˆi�w˜t˜fÐ%Ò&ðIð €Jó    c                  óV   — g d¢} | D �cg c]  }t        t        |«      sŒ|‘Œ c}S c c}w )N)Úfloat96Úfloat128Ú
complex192Ú
complex256)Úhasattrr   )Úextended_namesÚis     r-   Ú_get_extended_precision_listr8   G   s'   € ò€Nð &Ö8�!¬´°Q­ŠAÒ8Ð8ùÒ8s   ‰&Ÿ&c                  óh   — ddddœj                  t        j                  d«      j                  d«      S )NÚc_intÚc_longÚ
c_longlong)r7   ÚlÚqr,   )Úgetr   r%   Úchar© r/   r-   Ú_get_c_intp_namerB   P   s3   € ð ØØñ÷ 
�cŒ"�(‰(�3‹-×
Ñ
˜hÓ'ð	(r/   znumpy._typingr'   Ú_PRECISION_DICTÚ_EXTENDED_PRECISION_LISTÚ_C_INTP)ÚTypeAnalyser)ÚPRI_MED)Ú
ImportFromÚMypyFileÚ	Statement)ÚAnalyzeTypeContextÚPluginÚ	_HookFuncc                  óR   — t         t        gt        j                  j                  f   S ©N)r   rK   ÚmypyÚtypesÚTyperA   r/   r-   rM   rM   v   s   € ”XÔ1Ð2´D·J±J·O±OÐCÑDÐDr/   Úctxc                 ó¤   — | \  }}}|j                   j                  d«      d   }t        t        › d|› �   }t	        d|«      j                  |«      S )z;Replace a type-alias with a concrete ``NBitBase`` subclass.ú.éÿÿÿÿr   rF   )r*   ÚsplitrC   r'   r   Ú
named_type)rS   r+   Ú_Úapir*   Úname_news         r-   Ú_hookr\   x   sQ   € à‰ˆˆQ�Ø�x‰x�~‰~˜cÓ" 2Ñ&ˆÜ"¤g Y¨g°d°VÐ#<Ñ=ˆÜ�N CÓ(×3Ñ3°HÓ=Ð=r/   ÚiterableÚidc                 ól   — t        | «      D ]  \  }}t        |dd«      |k(  sŒ|c S  t        d|›�«      ‚)z>Identify the first ``ImportFrom`` instance the specified `id`.r^   NzBFailed to identify a `ImportFrom` instance with the following id: )Ú	enumerateÚgetattrÚ
ValueError)r]   r^   r7   Úvalues       r-   Ú_indexrd      sN   € ä! (Ó+ò 	‰HˆAˆuÜ�u˜d DÓ)¨RÓ/Ø’ð	ô ð 3Ø35°&ð:ó ;ð 	;r/   ÚfileÚmoduleÚimportsc                 óž   — t        |d|¬«      }d|_        | j                  t        d| j                  «      fD ]  }t        ||«      }|||<   Œ y)z<Override the first `module`-based import with new `imports`.r   )r(   Tzlist[Statement]N)rH   Úis_top_levelÚdefsr   rg   rd   )re   rf   rg   Ú
import_objÚlstr7   s         r-   Ú_override_importsrm   ‡   sU   € ô   ¨°Ô9ˆ
Ø"&ˆ
Ôð —I‘IœtÐ$5°t·|±|ÓDÐEò 	 ˆCÜ�s˜FÓ#ˆAØˆC�ŠFñ	 r/   c                   óH   — e Zd ZdZdededz  fd„Zdedee	e
ee
f      fd„Zy)Ú_NumpyPluginz>A mypy plugin for handling versus numpy-specific typing tasks.Úfullnamer	   Nc                 ó    — |t         v rt        S y)z«Set the precision of platform-specific `numpy.number`
            subclasses.

            For example: `numpy.int_`, `numpy.longlong` and `numpy.longdouble`.
            N)rC   r\   )Úselfrp   s     r-   Úget_type_analyze_hookz"_NumpyPlugin.get_type_analyze_hook™   s   € ð œ?Ñ*Ü�Ør/   re   c           	      óÊ   — |j                   }|dk(  r*t        |t        › d�t        D �cg c]  }||f‘Œ c}¬«       n|dk(  rt        |dt        dfg¬«       t
        |dfgS c c}w )a  Handle all import-based overrides.

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

            Únumpyz._extended_precision)rg   znumpy.ctypeslibÚctypesÚ_c_intprV   )rp   rm   r'   rD   rE   rG   )rr   re   rp   Úvs       r-   Úget_additional_depsz _NumpyPlugin.get_additional_deps£   sy   € ð —}‘}ˆHØ˜7Ò"Ü!ØÜ�iÐ3Ð4Ü-EÖF¨˜a šVÒFöð
 Ð.Ò.Ü!ØØÜ% yÐ1Ð2õô
 ˜h¨Ð+Ð,Ð,ùò Gs   ¨A )Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚstrrM   rs   rI   ÚlistÚtupleÚintry   rA   r/   r-   ro   ro   –   sB   „ ÙLð	°#ð 	¸)ÀdÑ:Jó 	ð	-Ø ð	-à�%˜˜S #˜Ñ&Ñ'ô	-r/   ro   Úversionc                 ó\   — dd l }d}d|› d|› d�}|j                  |t        d¬«       t        S )Nr   znumpy.typing.mypy_pluginú`zS` is deprecated, and will be removed in a future release. Please remove `plugins = z/` in your mypy config.(deprecated in NumPy 2.3)é   )Ú
stacklevel)ÚwarningsÚwarnÚDeprecationWarningro   )r‚   r‡   ÚpluginÚwarn_msgs       r-   rŠ   rŠ   ¼   sG   € Ûà+ˆð �ˆxð 1Ø17°ð 9(ð)ð 	ð
 	�‰�hÔ 2¸qˆÔAäÐr/   c                 ó   — t         ‚rO   )Ú_exc)r‚   s    r-   rŠ   rŠ   q   s   € Üˆ
r/   )0r}   Úcollections.abcr   r   Útypingr   r   r   ru   r   r   r   r~   Ú__annotations__Údictr.   r8   rB   r'   rC   rD   rE   Úmypy.typeanalrF   Ú
mypy.typesrP   Ú
mypy.buildrG   Ú
mypy.nodesrH   rI   rJ   Úmypy.pluginrK   rL   rM   rQ   rR   r\   r�   rd   r€   rm   ro   ÚtyperŠ   ÚModuleNotFoundErrorr�   rA   r/   r-   ú<module>r™      ss  ðò&÷P /ß -Ñ -ã à€ˆˆc‰Ó ð˜T # s (™^ó ð,9 d¨3¡ió 9ð(˜#ó (ð !€ˆÓ  ñ -Ó.€�Ó .ñ #?Ó"@Ð ˜%Ó @ñ "Ó#€ˆÓ #ðbÙÝ.ãÝ"ß:Ñ:ß6ö Eð>Ð%ð >¨$¯*©*¯/©/ó >ð;˜ )Ñ,ð ;°#ð ;¸#ó ;ð Øð àð ð �e˜C  t¡˜OÑ,Ñ-ð ð 
ó	 ô$-�vô $-ðL˜ð  ô øð[ ò ð˜ð  ÷ ð ûðús   Á*$C) Ã)D Ã.C;Ã;D 