L i3.UddlmZddlZddlmZddlmZmZmZm Z ddl Z ddl m Z ddl m Z e eZded<ed ed ef Zed e Zdd ZdddZ d ddZ d ddZ d ddZddZy)) annotationsN)Callable)AnyFinalTypeVarcast)config) get_loggerr_LOGGERTFunc.)boundTObjctjd}|tjjk(xstjj |S)aTrue if we should print deprecation warnings to the browser. Deprecation warnings are only shown when showErrorDetails is set to "full" or the legacy True value. All other values ("stacktrace", "type", "none", False) hide deprecation warnings in the browser. zclient.showErrorDetails)r get_optionShowErrorDetailsConfigOptionsFULLis_true_variation)show_error_detailss `/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/streamlit/deprecation_util.py!_error_details_in_browser_enabledrsJ **+DEfBBGGG V  / / A ABT Ucptr|rtj|tj|y)a3Show a deprecation warning message. Parameters ---------- message : str The deprecation warning message. show_in_browser : bool, default=True Whether to show the deprecation warning in the browser. When this is True, we will show the deprecation warning in the browser only if the user has set `client.showErrorDetails` to "full" or the legacy True value. All other values ("stacktrace", "type", "none", False) will hide deprecation warnings in the browser (but still log them to the console). N)r streamlitwarningr )messageshow_in_browsers rshow_deprecation_warningr-s()*'" OOGrc P|r d|}d|}d|d|d|d|d |rd|zSdzS) Nzst.zPlease replace `z` with `z`. `z` will be removed after .z )old_namenew_name removal_date extra_messageinclude_st_prefixs rmake_deprecated_name_warningr'Bsk # # 8*HXJ7 :-l^1 >%2T- ! <9; <rctjdfd }|_j|_t d|S)aWrap an `st` function whose name has changed. Wrapped functions will run as normal, but will also show an st.warning saying that the old name will be removed after removal_date. (We generally set `removal_date` to 3 months from the deprecation date.) Parameters ---------- func The `st.` function whose name has changed. old_name The function's deprecated name within __init__.py. removal_date A date like "2020-01-01", indicating the last day we'll guarantee support for the deprecated name. extra_message An optional extra message to show in the deprecation warning. name_override An optional name to use in place of func.__name__. c |i|}ttxs#tdrtjnd|S)N__name__unknown)rr'hasattrstrr*)argskwargsresultr%func name_overrider"r$s r wrapped_funcz)deprecate_func_name..wrapped_funcusRt&v& (T*1$ *CC &    rr )r.rr/rreturnr) functoolswrapsr*__doc__r)r1r"r$r%r2r3s````` rdeprecate_func_namer8TsIB__T   %L<z$deprecate_obj_name..s( ((LDU  r)_create_deprecated_obj_wrapper)objr"r#r$r&s ````rdeprecate_obj_namer>sD *   rc\ddfd GfddtdS)zCreate a wrapper for an object that has been deprecated. The first time one of the object's properties or functions is accessed, the given `show_warning` callback will be called. Fcs dyyNTr!)has_shown_warning show_warningsrmaybe_show_warningz:_create_deprecated_obj_wrapper..maybe_show_warnings! $  N!rcTeZdZdfd Zdfd ZeddZed fd Zy) /_create_deprecated_obj_wrapper..Wrapperc jjD]1}t|j|t|j |3yN)_get_magic_functions __class__setattrproperty_make_magic_function_proxy)selfnameWrapperr=s r__init__z8_create_deprecated_obj_wrapper..Wrapper.__init__sF44S]]C NNT<.Wrapper.__getattr__s1 t}}$tT**  3% %rcld}t|Dcgc]}||vr|jdr|c}Scc}w)N)rJrS__getattribute__rV__)dir startswith)self_clsignorerOs rrIzD_create_deprecated_obj_wrapper..Wrapper._get_magic_functionssCRF Mv%$//$*? s1cdfd }|S)Nc*tSrH)rT)_selfr.rDrOr=s rproxyzY_create_deprecated_obj_wrapper..Wrapper._make_magic_function_proxy..proxys"$sD))r)r`rr.rr4rr!)rOrarDr=s` rrMzJ_create_deprecated_obj_wrapper..Wrapper._make_magic_function_proxys *LrNr4None)rUr-r4r)r\z type[object]r4z list[str])rOr-r4zCallable[[Any], Any])r* __module__ __qualname__rQrV staticmethodrIrM)rPrDr=srrPrFs5  &        rrPrrb)r)r=rCrPrBrDs``@@@rr<r<s, &&P  ""r)r4bool)T)rr-rrgr4rcrA) r"r-r#r-r$r-r% str | Noner&rgr4r-)NN) r1r r"r-r$r-r%rhr2rhr4r ) r=rr"r-r#r-r$r-r&rgr4r)r=rrCzCallable[[], Any]r4r) __future__rr5collections.abcrtypingrrrrrr streamlit.loggerr r*r __annotations__r objectrrrr'r8r>r<r!rrros,#$,,'H%%xS12vV$ 2!%"      ,!% $ 2' 2'2'2' 2'  2'  2't# ) ))) )  )  )X6#r