L i)dZddlmZddlZddlZddlZddlmZmZddl m Z er ddl m Z ddl mZddZdd Zdd ZGd d eeefZdd Zy)zA bunch of useful utilities.) annotationsN) TYPE_CHECKINGAny) RootContainer)Callable)DeltaGeneratorcLgtjdfd }|S)z2Decorator to memoize the result of a no-args func.c>sjdS)Nr)append)funcresultsT/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/streamlit/util.py wrapped_funczmemoize..wrapped_func$s MM$& !ay)returnr) functoolswraps)r rr s` @rmemoizer s+F__T rcBjj}dddgtigtjr fdtj D}n#fdj jD}djd|D}|d|d S) zA clean repr for a class, excluding both values that are likely defaults, and those explicitly default for dataclasses. NFc3K|]m}|jr_t|j|jk7rzrepr_..6s^ vvaff%2aff%X5 VVWT166* + sA3A6c36K|]\}}|vs ||fywr)rrvrs rr!zrepr_..>s W&1aQhEV1vWs  z, c30K|]\}}|d|yw)=Nr#)rfieldvalues rr!zrepr_..@sQ\UEugQui0Qs()) __class____name__set dataclasses is_dataclassfields__dict__itemsjoin)r classname fields_vals field_reprsrs` @rrepr_r7-s''I UBr:H%  ''- XDMM,?,?,AW ))Q[QQK[+a ((rctjdd}t|tr|j dn|}|j ||j S)ziReturn the md5 hash of the given string. This should not be used for security-related purposes. md5F)usedforsecurityzutf-8)hashlibnew isinstancestrencodeupdate hexdigest)shbs rcalc_md5rEDsD  E51A'3/QAHHQK ;;=rc eZdZdZddZddZy)AttributeDictionarya A dictionary subclass that supports attribute-style access. This class extends the functionality of a standard dictionary to allow items to be accessed via attribute-style dot notation in addition to the traditional key-based access. If a dictionary item is accessed and is itself a dictionary, it is automatically wrapped in another `AttributeDictionary`, enabling recursive attribute-style access. c |j|}t|tr t|S|S#t$r+}t dt |jd|d|d}~wwxYw)N'z' object has no attribute ') __getitem__r=dictrGKeyErrorAttributeErrortyper,)r keyitemerrs r __getattr__zAttributeDictionary.__getattr__]so ##C(D0:40F&t, PD P  DJ''((CC5J  s+00 A$&AA$c|||<yrr#)r rr(s r __setattr__zAttributeDictionary.__setattr__fs T rN)rOr>rr)rr>r(rrNone)r, __module__ __qualname____doc__rRrTr#rrrGrGRsrrGcP|jjtjk(S)z.Check if the DeltaGenerator is in the sidebar.) _active_dg_root_containerrSIDEBAR)dgs r in_sidebarr^js == ( (M,A,A AAr)r Callable[..., Any]rr_)r rrr>)rBz bytes | strrr>)r]rrbool)rX __future__rr.rr;typingrr!streamlit.proto.RootContainer_pb2rcollections.abcrstreamlit.delta_generatorrrr7rErKrGr^r#rrrfsN#"%;(8 ). $sCx.0Br