L iUddlmZddlZddlmZmZmZddlmZm Z ddl m Z ddl m ZddlmZer ddlmZdd lmZeezZd ed <ddd Zdd ZddZGddZy)) annotationsN) TYPE_CHECKING TypeAliascast) LayoutConfigvalidate_width)StreamlitAPIException)Progress) clean_text)DeltaGenerator)WidthWithoutContentr FloatOrIntc||cxkxr|kncxs4tj||ddxstj||ddS)a+ Checks given value is 'between' the bounds of [low, high], considering close values around bounds are acceptable input. Notes ----- This check is required for handling values that are slightly above or below the acceptable range, for example -0.0000000000021, 1.0000000000000013. These values are little off the conventional 0.0 <= x <= 1.0 condition due to floating point operations, but should still be considered acceptable input. Parameters ---------- value : float low : float high : float g& .>)rel_tolabs_tol)mathisclose)valuelowhighs a/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/streamlit/elements/progress.py_check_float_betweenr#sF(    A <<sD$ ? A <<tT4 @ct|trd|cxkrdkr|Std|t|tr*t |ddrt|dzStd|tdt |j ) Nrdz+Progress Value has invalid value [0, 100]: ?)rrz-Progress Value has invalid value [0.0, 1.0]: z!Progress Value has invalid type: ) isinstanceintr floatrtype__name__)rs r _get_valuer#=s%   L #9% A  % 3S 9us{# ##;E7 C   +DK,@,@+AB rcn|yt|tr t|Stdt |d)NzProgress Text is of type zd, which is not an accepted type.Text only accepts: str. Please convert the text to an accepted type.)rstrr r r!)texts r _get_textr'PsC |$$  #DJ<0O O rc:eZdZ d ddZeddZy) ProgressMixinNct}t||_t|}|||_t |t |}|jjd||S)aDisplay a progress bar. Parameters ---------- value : int or float 0 <= value <= 100 for int 0.0 <= value <= 1.0 for float text : str or None A message to display above the progress bar. The text can optionally contain GitHub-flavored Markdown of the following types: Bold, Italics, Strikethroughs, Inline Code, Links, and Images. Images display like icons, with a max height equal to the font height. Unsupported Markdown elements are unwrapped so only their children (text contents) render. Display unsupported elements as literal characters by backslash-escaping them. E.g., ``"1\. Not an ordered list"``. See the ``body`` parameter of |st.markdown|_ for additional, supported Markdown directives. .. |st.markdown| replace:: ``st.markdown`` .. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown width : "stretch" or int The width of the progress element. This can be one of the following: - ``"stretch"`` (default): The width of the element matches the width of the parent container. - An integer specifying the width in pixels: The element has a fixed width. If the specified width is greater than the width of the parent container, the width of the element matches the width of the parent container. Example ------- Here is an example of a progress bar increasing over time and disappearing when it reaches completion: >>> import streamlit as st >>> import time >>> >>> progress_text = "Operation in progress. Please wait." >>> my_bar = st.progress(0, text=progress_text) >>> >>> for percent_complete in range(100): ... time.sleep(0.01) ... my_bar.progress(percent_complete + 1, text=progress_text) >>> time.sleep(1) >>> my_bar.empty() >>> >>> st.button("Rerun") .. output:: https://doc-status-progress.streamlit.app/ height: 220px )widthprogress) layout_config) ProgressProtor#rr'r&rrdg_enqueue)selfrr&r+progress_protor-s rr,zProgressMixin.progress\s^D')%0  "&N u$51 ww N-XXrctd|S)zGet our DeltaGenerator.r )r)r1s rr/zProgressMixin.dgs$d++r)Nstretch)rrr& str | Noner+r returnr )r6r )r" __module__ __qualname__r,propertyr/rrr)r)[sT %. KYKYKY# KY  KYZ,,rr))rr)rr rr rr r6bool)rrr6r)r&r5r6r5) __future__rrtypingrrr#streamlit.elements.lib.layout_utilsrrstreamlit.errorsr streamlit.proto.Progress_pb2r r.streamlit.string_utilr streamlit.delta_generatorr r rr r__annotations__rr#r'r)r:rrrDsS# 11L2B,8G e I#4&Q,Q,r