Ë
    ímxi¾  ã            
       ó>  — U d Z ddlmZmZ ddlmZ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# ee"gejH                  jJ                  f   Z&eed<   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Z0dede-fd!„Z.Y dZ0[0ydZ0[0w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Ú	TypeAliasÚ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        úO/home/htdocs/ttos/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_listr9   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)r8   ÚlÚqr-   )Úgetr   r&   Úchar© r0   r.   Ú_get_c_intp_namerC   P   s3   € ð ØØñ÷ 
�cŒ"�(‰(�3‹-×
Ñ
˜hÓ'ð	(r0   znumpy._typingr(   Ú_PRECISION_DICTÚ_EXTENDED_PRECISION_LISTÚ_C_INTP)ÚTypeAnalyser)ÚPRI_MED)Ú
ImportFromÚMypyFileÚ	Statement)ÚAnalyzeTypeContextÚPluginÚ	_HookFuncÚctxc                 ó¤   — | \  }}}|j                   j                  d«      d   }t        t        › d|› �   }t	        d|«      j                  |«      S )z;Replace a type-alias with a concrete ``NBitBase`` subclass.ú.éÿÿÿÿr   rG   )r+   ÚsplitrD   r(   r   Ú
named_type)rO   r,   Ú_Úapir+   Úname_news         r.   Ú_hookrX   x   sQ   € à‰ˆˆQ�Ø�x‰x�~‰~˜cÓ" 2Ñ&ˆÜ"¤g Y¨g°d°VÐ#<Ñ=ˆÜ�N CÓ(×3Ñ3°HÓ=Ð=r0   ÚiterableÚidc                 ól   — t        | «      D ]  \  }}t        |dd«      |k(  sŒ|c S  t        d|›�«      ‚)z>Identify the first ``ImportFrom`` instance the specified `id`.rZ   NzBFailed to identify a `ImportFrom` instance with the following id: )Ú	enumerateÚgetattrÚ
ValueError)rY   rZ   r8   Úvalues       r.   Ú_indexr`      sN   € ä! (Ó+ò 	‰HˆAˆuÜ�u˜d DÓ)¨RÓ/Ø’ð	ô ð 3Ø35°&ð:ó ;ð 	;r0   Ú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)rI   Úis_top_levelÚdefsr   rc   r`   )ra   rb   rc   Ú
import_objÚlstr8   s         r.   Ú_override_importsri   ‡   sU   € ô   ¨°Ô9ˆ
Ø"&ˆ
Ôð —I‘IœtÐ$5°t·|±|ÓDÐEò 	 ˆCÜ�s˜FÓ#ˆAØˆC�ŠFñ	 r0   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)rD   rX   )Úselfrl   s     r.   Úget_type_analyze_hookz"_NumpyPlugin.get_type_analyze_hook™   s   € ð œ?Ñ*Ü�Ør0   ra   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)rc   znumpy.ctypeslibÚctypesÚ_c_intprR   )rl   ri   r(   rE   rF   rH   )rn   ra   rl   Ú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__ÚstrrN   ro   rJ   ÚlistÚtupleÚintru   rB   r0   r.   rk   rk   –   sB   „ ÙLð	°#ð 	¸)ÀdÑ:Jó 	ð	-Ø ð	-à�%˜˜S #˜Ñ&Ñ'ô	-r0   rk   Ú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ÚDeprecationWarningrk   )r~   rƒ   ÚpluginÚwarn_msgs       r.   r†   r†   ¼   sG   € Ûà+ˆð �ˆxð 1Ø17°ð 9(ð)ð 	ð
 	�‰�hÔ 2¸qˆÔAäÐr0   c                 ó   — t         ‚)N)Úe)r~   s    r.   r†   r†   q   s   € Üˆr0   )1ry   Úcollections.abcr   r   Útypingr   r   r   r   rq   r   r	   r{   rz   Ú__annotations__Údictr/   r9   rC   r(   rD   rE   rF   Úmypy.typeanalrG   Ú
mypy.typesÚmypyÚ
mypy.buildrH   Ú
mypy.nodesrI   rJ   rK   Úmypy.pluginrL   rM   ÚtypesÚTyperN   rX   r}   r`   r|   ri   rk   Útyper†   ÚModuleNotFoundErrorr‰   rB   r0   r.   ú<module>r˜      s�  ðò&÷P /ß 8Ó 8ã à€ˆˆc‰Ó ð˜T # s (™^ó ð,9 d¨3¡ió 9ð(˜#ó (ð !€ˆÓ  ñ -Ó.€�Ó .ñ #?Ó"@Ð ˜%Ó @ñ "Ó#€ˆÓ #ðbÙÝ.ãÝ"ß:Ñ:ß6ð $Ð%7Ð$8¸$¿*¹*¿/¹/Ð$IÑJ€IˆyÓJð>Ð%ð >¨$¯*©*¯/©/ó >ð;˜ )Ñ,ð ;°#ð ;¸#ó ;ð Øð àð ð �e˜C  t¡˜OÑ,Ñ-ð ð 
ó	 ô$-�vô $-ðL˜ð  ô øð[ ò ð˜ð  ÷ ð ûðús   Á,$D ÄDÄ
DÄD