
    *i              
       Z   % S r SSKJrJr  SSKJrJrJrJr  SSK	r
/ r\\   \S'   S\\\4   4S jrS\\   4S jrS\4S	 jrS
r\\S'   \" 5       r\\S'   \" 5       r\\S'   \" 5       r\\S'    \(       a  SSKJr  SSKrSSKJr  SSKJrJrJ r   SSK!J"r"J#r#  \\"/\RH                  RJ                  4   r&\\S'   S\"S\RH                  RJ                  4S jr'S\\    S\S\(4S jr)S\S\S\\*\\S-  4      SS4S jr+ " S S\#5      r,S\S\-4S  jr.g! \/ a  r0S\S\-4S! jr. Sr0C0gSr0C0ff = f)"a  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

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                     S[         R                  4S[         R                  4S[         R                  4S[         R                  4S[         R
                  4S[         R                  4S[         R                  4S[         R                  4S	[         R                  4S
[         R                  4S[         R                  4/n 0 nU  H@  u  p#S[         R                  " U5      R                  -  n[         SU S3U[         SU 3'   MB     U$ )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        V/var/www/html/ai-backend/venv/lib/python3.13/site-packages/numpy/typing/mypy_plugin.py_get_precision_dictr/   ,   s    	bgg	rxx 	bgg	bgg	RWW	bgg	"++&	bgg			"			"	BMM*E C	&&&,39M!C)Hwiwtf%&  J    c                  h    / SQn U  Vs/ s H  n[        [        U5      (       d  M  UPM     sn$ s  snf )N)float96float128
complex192
complex256)hasattrr   )extended_namesis     r.   _get_extended_precision_listr9   B   s+    N &8~!QA~888s   //c                  j    SSSS.R                  [        R                  " S5      R                  S5      $ )Nc_intc_long
c_longlong)r8   lqr-   )getr   r&   char r0   r.   _get_c_intp_namerC   K   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                     U u  pnUR                   R                  S5      S   n[        [         SU 3   n[	        SU5      R                  U5      $ )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   s   sO    xx~~c"2&"gYgdV#<=NC(33H==r0   iterableidc                 r    [        U 5       H  u  p#[        USS5      U:X  d  M  Us  $    [        SU< 35      e)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`   z   sG    !(+HAudD)R/ ,  335&: ; 	;r0   filemoduleimportsc                     [        USUS9nSUl        U R                  [        SU R                  5      4 H  n[        XA5      nX4U'   M     g)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      sM      9
"&
 IIt$5t||DECs#AF Fr0   c                   T    \ rS rSrSrS\S\S-  4S jrS\S\	\
\\\4      4S jrS	rg)
_NumpyPlugin   z>A mypy plugin for handling versus numpy-specific typing tasks.fullnamer
   Nc                 $    U[         ;   a  [        $ g)zSet the precision of platform-specific `numpy.number`
subclasses.

For example: `numpy.int_`, `numpy.longlong` and `numpy.longdouble`.
N)rD   rX   )selfrm   s     r.   get_type_analyze_hook"_NumpyPlugin.get_type_analyze_hook   s     ?*r0   ra   c           	          UR                   nUS:X  a)  [        U[         S3[         Vs/ s H  o3U4PM     snS9  OUS:X  a  [        US[        S4/S9  [
        US4/$ s  snf )zHandle 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   )rm   ri   r(   rE   rF   rH   )ro   ra   rm   vs       r.   get_additional_deps _NumpyPlugin.get_additional_deps   s}     }}H7"!i34-EF-EV-EF
 ..!%y12
 h+,, Gs   ArB   )__name__
__module____qualname____firstlineno____doc__strrN   rp   rJ   listtupleintrw   __static_attributes__rB   r0   r.   rk   rk      sB    L	# 	)d:J 		- 	-%S#&'	-r0   rk   versionc                 V    SS K nSnSU SU S3nUR                  U[        SS9  [        $ )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 117 9() 	
 	h 2qAr0   c                     [         e)N)e)r   s    r.   r   r   l   s    r0   )1r}   collections.abcr   r   typingr   r   r   r   rs   r   r	   r   r~   __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  !F / 8 8 c T#s(^ ,9d3i 9(# ( !   -. . #?"@ % @ "# #b."::6 $%7$8$**//$IJIyJ>% >$**// >;), ;# ;# ;    eCtO,-  
	 $-v $-L  [     s   /)D D*	D%%D*