
    &e                        d dl Z d dlmZmZmZ d dlmZ d dlmZ d dl	m
Z
mZmZ d dlmZ d dlmZmZmZ d dlmZ d	ed
ededededdfdZdededededdf
dZdee         ddfdZdeeef         dededdfdZdeddfdZe j        ded         fd            Zd dl	mZ d dlmZ  ed          Z  ed          Z!d e d!Z" ed"e"#          Z#d$e d!Z$ ed%e$#          Z%g d&Z&dS )'    N)AnyIteratorUnion)Message)Block)CACHE_DATA_MESSAGE_REPLAY_CTXCacheDataAPI_data_caches)CACHE_DOCS_URL)!CACHE_RESOURCE_MESSAGE_REPLAY_CTXCacheResourceAPI_resource_caches)WidgetMetadata
delta_typeelement_protoinvoked_dg_id
used_dg_idreturned_dg_idreturnc                 f    t          j        | ||||           t          j        | ||||           dS )zSave the message for an element to a thread-local callstack, so it can
    be used later to replay the element when a cache-decorated function's
    execution is skipped.
    N)r   save_element_messager   )r   r   r   r   r   s        Blib/python3.11/site-packages/streamlit/runtime/caching/__init__.pyr   r   #   sP     "6M=*n   &:M=*n        block_protoc                 b    t          j        | |||           t          j        | |||           dS )zSave the message for a block to a thread-local callstack, so it can
    be used later to replay the block when a cache-decorated function's
    execution is skipped.
    N)r   save_block_messager   )r   r   r   r   s       r   r   r   6   sL     "4]J   &8]J    r   metadatac                 V    t          j        |            t          j        |            dS )zSave a widget's metadata to a thread-local callstack, so the widget
    can be registered again when that widget is replayed.
    N)r   save_widget_metadatar   )r   s    r   r   r   H   s,     "6x@@@%:8DDDDDr   
image_datamimetypeimage_idc                 ^    t          j        | ||           t          j        | ||           d S N)r   save_image_datar   )r    r!   r"   s      r   save_media_datar&   P   s4     "1*hQQQ%5j(HUUUUUr   st_func_namec                 Z    t          j        | |           t          j        | |           d S r$   )r   %maybe_show_cached_st_function_warningr   )dgr'   s     r   r)   r)   W   sB    !G
L   &K
L    r   c               #      K   t          j                    5  t          j                    5  d V  d d d            n# 1 swxY w Y   d d d            d S # 1 swxY w Y   d S r$   )r   #suppress_cached_st_function_warningr    r   r   r,   r,   `   s      	&	J	L	L  No  OT  OV  OV                                  s.   A;A?	A?	AAA)get_data_cache_stats_provider)!get_resource_cache_stats_provider
cache_data)decorator_metric_namecache_resourcez`st.experimental_memo` is deprecated. Please use the new command `st.cache_data` instead, which has the same behavior. More information [in our docs](z).experimental_memo)r1   deprecation_warningz`st.experimental_singleton` is deprecated. Please use the new command `st.cache_resource` instead, which has the same behavior. More information [in our docs](experimental_singleton)r   r   r   r   r&   r)   r,   r.   r/   r0   r2   r3   r5   )'
contextlibtypingr   r   r   google.protobuf.messager   streamlit.proto.Block_pb2r   (streamlit.runtime.caching.cache_data_apir   r	   r
   &streamlit.runtime.caching.cache_errorsr   ,streamlit.runtime.caching.cache_resource_apir   r   r   streamlit.runtime.state.commonr   strr   r   r   bytesr&   r)   contextmanagerr,   r.   r/   r0   r2   _MEMO_WARNINGr3   _SINGLETON_WARNINGr5   __all__r-   r   r   <module>rD      s!       ' ' ' ' ' ' ' ' ' ' + + + + + + + + + + + +         
 B A A A A A         
 : 9 9 9 9 9  	
  
   &  	
 
   $E>##6 E4 E E E EVeSj!V-0V<?V	V V V VC D     Xd^     S R R R R R     
 \===
!!8HIIIVCQV V V 
 !L-=   
VCQV V V 
 *)2*     r   