§ x<ˆjOãó¤—UdZddlmZddlmZddlmZmZmZddl Z ddl Z ddl m Z ddlmZmZddlmZmZmZdd lmZeege fZdZd ed <n#e$r ZeZYdZ[ndZ[wwxYwgZd ed <d.d„Zd/d„Zd0d„Ze¦«Z ded<e¦«Z!ded<e¦«Z"ded<d1d„Z#ese€d2d „Z$d3d'„Z%Gd(„d)e¦«Z&d4d,„Z'dSd4d-„Z'dS)5aA 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 ` 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: http://mypy-lang.org/ .. _configuration file: https://mypy.readthedocs.io/en/stable/config_file.html é)Ú annotations)ÚIterable)ÚFinalÚ TYPE_CHECKINGÚCallableN)ÚType)ÚPluginÚAnalyzeTypeContext)ÚMypyFileÚ ImportFromÚ Statement)ÚPRI_MEDzNone | ModuleNotFoundErrorÚMYPY_EXú list[str]Ú__all__Úreturnúdict[str, str]c óh—dtjfdtjfdtjfdtjfdtjfdtjfdtjfdtjfd tj fd tj fg }i}|D](\}}d |¦«j j z}d |›d �|d|›�<Œ)|S)NÚ _NBitByteÚ _NBitShortÚ _NBitIntCÚ _NBitIntPÚ_NBitIntÚ _NBitLongLongÚ _NBitHalfÚ _NBitSingleÚ _NBitDoubleÚ_NBitLongDoubleéznumpy._ÚBitúnumpy._typing._nbit.) ÚnpÚbyteÚshortÚintcÚintpÚint_ÚlonglongÚhalfÚsingleÚdoubleÚ longdoubleÚdtypeÚitemsize)ÚnamesÚretÚnameÚtypÚns úl/builddir/build/BUILD/cloudlinux-venv-1.0.12/venv/lib64/python3.11/site-packages/numpy/typing/mypy_plugin.pyÚ_get_precision_dictr58s€à •b”gÐØ •r”xÐ Ø •b”gÐØ •b”gÐØ •R”WÐØ �"œ+Ð&à •b”gÐØ �œ Ð"Ø �œ Ð"Ø �BœMÐ*ð €Eð €CØð>ð>‰ ˆˆcØ�S�S‘U”U”[Ô)Ñ)ˆØ-=°qÐ-=Ð-=Ð-=ˆÐ ) 4Ð )Ð )Ñ*Ð*Ø €Jóc󄇗tjtjtjtjg}hd£Šˆfd„|D¦«S)N> Úint128Úint256Úfloat80Úfloat96Úuint128Úuint256Úfloat128Úfloat256Ú complex160Ú complex192Ú complex256Ú complex512có0•—g|]}|j‰v¯ |j‘ŒS©)Ú__name__)Ú.0ÚiÚextended_namess €r4ú z0_get_extended_precision_list..]s'ø€Ð OÐ OÐ O˜1°!´*ÀÐ2NÐ2NˆAŒJÐ2NÐ2NÐ2Nr6)r"Ú ulonglongr(r,Ú clongdouble)Úextended_typesrIs @r4Ú_get_extended_precision_listrNMsGø€Ý”l¥B¤Kµ´ÅÄÐO€Nð ð ð €Nð PÐ OÐ OÐ O Ð OÑ OÔ OÐOr6Ústrcóh—tjd¦«j}|dkrdS|dkrdS|dkrdSdS)NÚprHÚc_intÚlÚc_longÚqÚ c_longlong)r"r-Úchar)rWs r4Ú_get_c_intp_namerX`sA€å Œ8�C‰=Œ=Ô €DØ ˆs‚{€{؈wØ �ŠˆØˆxØ �ŠˆØˆ|àˆxr6rÚ_PRECISION_DICTÚ_EXTENDED_PRECISION_LISTÚ_C_INTPÚctxr rcó˜—|\}}}|j d¦«d}td|›�}| |¦«S)z;Replace a type-alias with a concrete ``NBitBase`` subclass.ú.éÿÿÿÿr!)r1ÚsplitrYÚ named_type)r\r2Ú_Úapir1Úname_news r4Ú_hookrexsJ€à�K€CˆˆCØ Œ8�>Š>˜#Ñ Ô ˜rÔ "€DÝÐ<°dÐ<Ð<Ô=€HØ �>Š>˜(Ñ #Ô #Ð#r6ÚiterableúIterable[Statement]ÚidÚintcó‚—t|¦«D]\}}t|dd¦«|kr|cSŒtd|›�¦«‚)z>Identify the first ``ImportFrom`` instance the specified `id`.rhNzBFailed to identify a `ImportFrom` instance with the following id: )Ú enumerateÚgetattrÚ ValueError)rfrhrHÚvalues r4Ú_indexro�sf€å! (Ñ+Ô+ð ð ‰HˆAˆuÝ�u˜d DÑ)Ô)¨RÒ/Ð/Ø���ð0åð:Ø35ð:ð:ñ;ô;ð ;r6Úfiler ÚmoduleÚimportsúlist[tuple[str, None | str]]ÚNonecó„—t|d|¬¦«}d|_|j|jfD]}t ||¦«}|||<ŒdS)zA mypy plugin for handling versus numpy-specific typing tasks.ÚfullnamerOrúNone | _HookFunccó&—|tvrtSdS)z«Set the precision of platform-specific `numpy.number` subclasses. For example: `numpy.int_`, `numpy.longlong` and `numpy.longdouble`. N)rYre)Úselfr}s r4Úget_type_analyze_hookz"_NumpyPlugin.get_type_analyze_hook›s€ð �?Ð*Ð*Ý� Ø�4r6rpr úlist[tuple[int, str, int]]cóÊ—t|jdfg}|jdkr"t|dd„tD¦«¬¦«n%|jdkrt|dtdfg¬¦«|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‘ŒSrErE)rGÚvs r4rJz4_NumpyPlugin.get_additional_deps..µs€ÐFÐFÐF¨˜a ˜VÐFÐFÐFr6)rrznumpy.ctypeslibÚctypesÚ_c_intp)rr}rzrZr[)r€rpr0s r4Úget_additional_depsz _NumpyPlugin.get_additional_deps¥s”€õ˜Tœ]¨BÐ/Ð0ˆCàŒ} Ò'Ð'Ý!ØÐ=ØFÐFÕ-EÐFÑFÔFðñôððð”Ð"3Ò3Ð3Ý!ؘ(Ý% yÐ1Ð2ðñôððˆJr6N)r}rOrr~)rpr rr‚)rFÚ __module__Ú __qualname__Ú__doc__r�r‰rEr6r4r|r|˜sB€€€€€ØLÐLð ð ð ð ð ð ð ð ð ð r6r|Úversionútype[_NumpyPlugin]có—tS©zAn entry-point for mypy.)r|©r�s r4Úpluginr’¾s€åÐr6có—t‚r�)rr‘s r4r’r’Ãs€åˆ r6)rr)rr)rrO)r\r rr)rfrgrhrOrri)rpr rqrOrrrsrrt)r�rOrrŽ)(rŒÚ __future__rÚcollections.abcrÚtypingrrrr„r"Ú mypy.typesÚmypyrÚ mypy.pluginr r Ú mypy.nodesr r r Ú mypy.buildrÚ _HookFuncrÚ__annotations__ÚModuleNotFoundErrorÚexrr5rNrXrYrZr[rerorzr|r’rEr6r4ú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øøøøðøøøð€ÐÐÐÑððððð*PðPðPðPð& ð ð ð ð-Ð,Ñ.Ô.€Ð.Ð.Ð.Ñ.ð#?Ð">Ñ"@Ô"@ÐÐ@Ð@Ð@Ñ@ð"Ð!Ñ#Ô#€Ð#Ð#Ð#Ñ#ð$ð$ð$ð$ððE�G�Oð;ð;ð;ð;ð  ð  ð  ð  ð$ð$ð$ð$ð$�vñ$ô$ð$ðLðððððð ðððððsŸ4AÁA%ÁA Á A%