L i0 dddlmZddlZddlZddlmZddlmZddl m Z ddl m Z GddZ y) ) annotationsN)Any)config)magic)open_python_filec(eZdZdZddZddZddZy) ScriptCachez,Thread-safe cache of Python script bytecode.cDi|_tj|_y)N)_cache threadingLock_lockselfs q/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/script_cache.py__init__zScriptCache.__init__s&( ^^% cz|j5|jjdddy#1swYyxYw)z~Remove all entries from the cache. Notes ----- Threading: SAFE. May be called on any thread. N)rr clearrs rrzScriptCache.clear"s0ZZ KK      s1:c tjj|}|j5|jj |d}| |cdddSt |5}|j}dddtjdrtj|}t|dddd}||j|<|cdddS#1swY_xYw#1swYyxYw)a\Return the bytecode for the Python script at the given path. If the bytecode is not already in the cache, the script will be compiled first. Raises ------ Any Exception raised while reading or compiling the script. Notes ----- Threading: SAFE. May be called on any thread. Nzrunner.magicEnabledexecr)modeflags dont_inheritoptimize) ospathabspathrr getrreadr get_optionr add_magiccompile)r script_pathbytecodeffilebodys r get_bytecodezScriptCache.get_bytecode,sggook2 ZZ {{{D9H#   "+. $!668 $  !67 ??8[A H(0DKK $9   $ $  s* C C!C2ACC CC%N)returnNone)r&strr+r)__name__ __module__ __qualname____doc__rrr*rrr r s6&  -rr ) __future__ros.pathrr typingr streamlitrstreamlit.runtime.scriptrunnerrstreamlit.source_utilrr r2rrr9s&#02??r