rL i{N dZddlZddlZddlZddlZddlZGddeZ ddddZdddddddd d Z dddddddd d Z Gd d Z iZ ddZ GddZeZddZddZdddZej&dZy)a  Helper functions for deprecating parts of the Matplotlib API. This documentation is only relevant for Matplotlib developers, not for users. .. warning:: This module is for internal use only. Do not use it in your own code. We may change the API at any time with no warning. NceZdZdZy)MatplotlibDeprecationWarningz>A class for issuing deprecation warnings for Matplotlib users.N)__name__ __module__ __qualname____doc__a/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/matplotlib/_api/deprecation.pyrrsHr rFremovalc |r |r7td|dk(r'|jd^}} } |dt| dz}|s%|rdnd|rdnd|rd ndzzdz|rd ndz|rd ndz}|rtnt} | |t ||||||| zS) Nz5A pending deprecation cannot have a scheduled removalr .zThe %(name)s %(obj_type)sz%(name)sz' will be deprecated in a future versionz' was deprecated in Matplotlib %(since)sz# and will be removed in %(removal)sz Use %(alternative)s instead.z %(addendum)s)funcnameobj_typesincer alternativeaddendum) ValueErrorsplitintPendingDeprecationWarningrdict) rmessagerrpendingrrrmacromeso_ warning_clss r _generate_deprecation_warningr#s TU U B++c*taG1SY]O, ,4 (*:A 678?4RI K    1< ,  E !)_b  2 07+.deprecate..finalizesE")CK =ys||.deprecate.._deprecated_propertycR||t|rt| ||Sr0) isinstancesuper__get__)selfinstanceowner __class__r- emit_warnings r r?zCdeprecated..deprecate.._deprecated_property.__get__s.+u/@ *4 ?$ 7?8U;;r c6|t|||Sr0)r>__set__)r@rAvaluerCrDs r rFzCdeprecated..deprecate.._deprecated_property.__set__s+$ 7?8U;;r c4|t||Sr0)r> __delete__)r@rArCrDs r rIzFdeprecated..deprecate.._deprecated_property.__delete__s+$ 7-h77r cdk(r|yy)Nzr )r@rBset_namers r __set_name__zHdeprecated..deprecate.._deprecated_property.__set_name__sz)'*r r0)rrrr?rFrIrL __classcell__)rCr-rDrs@r _deprecated_propertyr;s< < 8 ((r rNcXjjj|S)N)fgetfsetfdeldoc)rPrQrR)r!r6rNr7s r r8z/deprecated..deprecate..finalizes'+sxxWNNr functioncLtj|}||_|Sr0)r2r3r)r5r6rs r r8z/deprecated..deprecate..finalizes$/)//$/8")r c ,ty)Nr$)r*)rrrrrrrrsr rDz3deprecated..deprecate..emit_warnings wT{(X !r c"|i|Sr0r )argskwargsrDrs r r5z.deprecated..deprecate..wrappers N(( (r r  z Notes ----- zUse z instead.z[*Deprecated*] z .. deprecated:: z z\ ) matplotlib._apir-r=typer4rrpropertyrPinspectcleandocstripjoin)r7rrrrrrold_docr8r5 notes_headert second_argr6rNr-rDrrrs``````` @@@@r deprecatezdeprecated..deprecate~s1 c4 "<z.s'$!D6 ";r c$t|d|Sro)setattr)r@rGrs r rqz.s4&z5)Ir )r)rsrlr^)r@rBrs `r rLz*deprecate_privatize_attribute.__set_name__s1tT__ ;I K- r N)rrrrr4rLr r r rjrjs 6r rjcbtjt}|Stj}|j vsJddj d|j vsJddj dtjfd}|t|<|S)a Decorator indicating that parameter *old* of *func* is renamed to *new*. The actual implementation of *func* should use *new*, not *old*. If *old* is passed to *func*, a DeprecationWarning is emitted, and its value is used, even if *new* is also passed by keyword (this is to simplify pyplot wrapper functions, which always pass *new* explicitly to the Axes method). If *new* is also passed but positionally, a TypeError will be raised by the underlying function during argument binding. Examples -------- :: @_api.rename_parameter("3.1", "bad_name", "good_name") def func(good_name): ... Matplotlib internal error: z cannot be a parameter for () must be a parameter for c |vr8tddjddd |j|<|i|S)NzThe z parameter of z() has been renamed z since Matplotlib z:; support for the old name will be dropped in %(removal)s.r)r*rpop)rXrYrnewoldrs r r5z!rename_parameter..wrappersh &= cWN4==/J$$'7*r )r@s r __repr__z$_deprecated_parameter_class.__repr__3s'r N)rrrrr r r rr2s(r rc  tjtfi}|Stj t d j jDd  j vr j j}|tjju |tjju s s|tjjurtjng j j j! j jDcgc])}|j"k(r|j!t$n|+c}x_ n1d n.dx tj sJddj(d j+d dtj,   f d }|t.|<|Scc}w) aI Decorator indicating that parameter *name* of *func* is being deprecated. The actual implementation of *func* should keep the *name* parameter in its signature, or accept a ``**kwargs`` argument (through which *name* would be passed). Parameters that come after the deprecated parameter effectively become keyword-only (as they cannot be passed positionally without triggering the DeprecationWarning on the deprecated parameter), and should be marked as such after the deprecation period has passed and the deprecated parameter is removed. Parameters other than *since*, *name*, and *func* are keyword-only and forwarded to `.warn_deprecated`. Examples -------- :: @_api.delete_parameter("3.1", "unused") def func(used_arg, other_arg, unused, more_args): ... Nc3K|]7}|jtjjk(r|j9ywr0)kindr_ Parameter VAR_KEYWORDr).0params r z#delete_parameter..\s5Hu ::):):)F)FF Hs=?)defaultrFrurwrvrc t| kr |vr|i|S j|i|j}r-|j rt dj dnr-|j rt dj dn]t fd||j ifDr7d d}t ft dj d rd z|zn|d |i|S) Nz#Additional positional arguments to zV() are deprecated since %(since)s and support for them will be removed in %(removal)s.ryz Additional keyword arguments to c3BK|]}|vxr |tk7ywr0)_deprecated_parameter)rdrs r rz4delete_parameter..wrapper..s1G?qw*???GszIf any parameter follows z5, they should be passed as keyword, not positionally. parameter of rvr[)rrr)lenbind argumentsgetr*ranyrepr) inner_args inner_kwargsrdeprecation_addendumrr is_varargs is_varkwargsrY kwargs_namername_idxrrs r r5z!delete_parameter..wrapperysB z?h &4|+C4|4 4"INNJ?,?II )--- !D==/"C D EimmD1 !A==/"C D E G$immK&DEGG,D84-. !  $Z(r:DL(S.+??2     Z0<00r )r2r}delete_parameterr_rnextrvaluesrrVAR_POSITIONALr KEYWORD_ONLYmathinfindexreplacerr __signature__rrzr3r)rrrrYrrrr5rrrrrrs```` @@@@@@r rr:s2!!"2E4J6JI |!!$'IH 0D0D0K0K0MHIMOK y#####D)..W..=== w00<<< ,!G$5$5$B$BB-y++,2248  .7->->'1188:K<::% &; <+01K<->.= =D  H$)) \88 ")$1J}}oR ! "{zz*d+H__T111@$Jw NeK.wrappersI t9x   EmDMM?"$E  G T$V$$r )rr)r2r}make_keyword_onlyr_rrPOSITIONAL_OR_KEYWORDrrrrrr3rrrrr) rrrrrPOKKWOnameskwonlyr5rrs ``` @r rrs!!"3UDAI |!!$'I    1 1C    ( (C I(( ($$T*//36V %dX.(T UV 7 $i"" #E{{4 H$XY/9t%%d+00C79F9__T % %&--))002:4 $)::#7 3 UB:4-5G$Jw N+9":4s %F)F ) allow_emptyc jd}d}|j}t||}t|t|rt|tr|n|j |}||k7rX|rDtt|dddd|j j |j j fvrtdi|dd||Sy) a Return ``obj.method`` with a deprecation if it was overridden, else None. Parameters ---------- method An unbound method, i.e. an expression of the form ``Class.method_name``. Remember that within the body of a method, one can always use ``__class__`` to refer to the class that is currently being defined. obj Either an object of the class where *method* is defined, or a subclass of that class. allow_empty : bool, default: False Whether to allow overrides by "empty" methods without emitting a warning. **kwargs Additional parameters passed to `warn_deprecated` to generate the deprecation warning; must at least include the "since" key. cyr0r r r r emptyz(deprecate_method_override..emptyr cy)rSNr r r r empty_with_docstringz7deprecate_method_override..empty_with_docstringrr __code__Nco_codemethod)rrr )rrpr=r]r?rrr*) rr7rrYrrr bound_child bound_bases r deprecate_method_overriders,) ??D#t$K k4; /JsD4I  ^^C  z! W[*dC&."^^331::BBDD I4XHHI r c#Ktj5tjdtddddy#1swYyxYww)Nignore)warningscatch_warnings simplefilterrr r r 'suppress_matplotlib_deprecation_warningrs:  "h(DE sA ? A AA )r r r Fr r r0)r contextlibr2r_rrDeprecationWarningrr#r*rhrjrr~rrrrrcontextmanagerrr r r rs  I#5I MO5 "5222ub".Bb"$""er2yx> 0f(( 45aH.b;@'T r