L ivddlmZddlZddlZddlZddlmZmZejdk\rddlm Z nddl m Z erejdk\rddlm Z nddl m Z gdZ Gd d eZ dd Zdded d  ddZ deddd ddZe Z GddZea ddZy)) annotationsN) TYPE_CHECKINGLiteral) ) deprecated)r ) LiteralString)AltairDeprecationWarningrdeprecated_static_onlydeprecated_warnc eZdZy)r N)__name__ __module__ __qualname__^/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/altair/utils/deprecation.pyr r srr c8d|d}|r|d|d}|r|d|S|S)Nz Deprecated since `altair=z`.z Use z instead. r)version alternativemessageoutputs r_format_messagers? +7)2 6F85 Y7%,fXRy !8&8r)rrcategory stacklevelc8t|||}t|||S)a Indicate that a class, function or overload is deprecated. When this decorator is applied to an object, the type checker will generate a diagnostic on usage of the deprecated object. Parameters ---------- version ``altair`` version the deprecation first appeared. alternative Suggested replacement class/method/function. message Additional message appended to ``version``, ``alternative``. category If the *category* is ``None``, no warning is emitted at runtime. stacklevel The *stacklevel* determines where the warning is emitted. If it is ``1`` (the default), the warning is emitted at the direct caller of the deprecated object; if it is higher, it is emitted further up the stack. Static type checker behavior is not affected by the *category* and *stacklevel* arguments. References ---------- [PEP 702](https://peps.python.org/pep-0702/) rr)r _deprecated)rrrrrmsgs rrr-s"H '; 8C sX* EEr)rrractionct|||}|tj|||y|dk(rt|||yt |)ar Indicate that the current code path is deprecated. This should be used for non-trivial cases *only*. ``@deprecated`` should always be preferred as it is recognized by static type checkers. Parameters ---------- message Explanation of the deprecated behaviour. .. note:: Unlike ``@deprecated``, this is *not* optional. version ``altair`` version the deprecation first appeared. alternative Suggested replacement argument/method/function. category The runtime warning type emitted. stacklevel How far up the call stack to make this warning appear. A value of ``2`` attributes the warning to the caller of the code calling ``deprecated_warn()``. References ---------- [warnings.warn](https://docs.python.org/3/library/warnings.html#warnings.warn) Nr once)rwarningswarn _warn_onceNotImplementedError)rrrrrr$r"s rr r UsGL '; 8C ~ cHD 6 3jA!&))rc,eZdZddZddZddZddZy) _WarningsMonitorcDi|_tj|_yN)_warned threadingLock_lockselfs r__init__z_WarningsMonitor.__init__s;= ^^% rcb|j5||jvcdddS#1swYyxYwr.r2r/r4keys r __contains__z_WarningsMonitor.__contains__s* ZZ '$,,& ' ' 's%.cd|j5d|j|<dddy#1swYyxYw)NTr7r8s rhitz_WarningsMonitor.hits, ZZ % $DLL  % % %s&/cz|j5|jjdddy#1swYyxYwr.)r2r/clearr3s rr>z_WarningsMonitor.clears. ZZ ! LL    ! ! !s1:N)returnNone)r9r r?bool)r9r r?r@)rrrr5r:r<r>rrrr,r,s&'%!rr,cv|tvrytj|tj|||dzy)Nrr )_warnings_monitorr<r'r()r"rrs rr)r)s2 c" cHaHr)rr rLiteralString | NonerrDr?r ) rr rrDrrDrz%type[AltairDeprecationWarning] | Nonerint)rr rr rrDrtype[AltairDeprecationWarning]rrEr$zLiteral['once'] | Noner?r@)r"r rrFrrEr?r@) __future__rsysr0r'typingrr version_inforr!typing_extensionsr __all__DeprecationWarningr rr r r,rCr)rrrrNsk" )w2; 7"(3 817 9  9% 9" 9  9")-$(6N %F %F&%F" %F 4 %F  %FX)-/G%),* ,*,*& ,* - ,*  ,* #,* ,*^%D!!$%&I I(FITWI Ir