
    ch                        S SK Jr  S SKrS SKrS SKrS SKrS SKrS SKJrJ	r	J
r
Jr  S SKJr  \(       a  S SKJrJr  \R"                  " S5      r\R"                  " S5      r\" S5      \R(                   S   SS	 jj5       5       rSS
 jrSS jrg)    )annotationsN)TYPE_CHECKINGAnyLiteralcast)gather_metrics)	GeneratorIterablez\s*z\s*
echoc              #    ^^#    SSK JnJnJnJn  U S:X  a  UnUnOU" 5       nUR                  nUR                  n [
        R                  " 5       S   nUR                  UR                  =(       d    SpUR                  U	5       nUR                  5       nSSS5        [        R                  " SR                  W5      5      n0 mSUU4S jjmT" U5        TU
   R                  S   R                  S-
  nTU
   R                  nXU n[         R"                  " SR                  U5      5      nSv   U" US	5        g! , (       d  f       N= f! [$         a  nU" S
U 35         SnAgSnAff = f7f)aR  Use in a `with` block to draw some code on the app, then execute it.

Parameters
----------
code_location : "above" or "below"
    Whether to show the echoed code before or after the results of the
    executed code block.

Example
-------
>>> import streamlit as st
>>>
>>> with st.echo():
>>>     st.write('This code will be printed')

r   )codeemptysource_utilwarningbelowN c                   > [        U S5      (       d  g [        R                  " U 5       H7  n[        US5      (       d  M  UT[        SUR                  5      '   T" U5        M9     g )Nbodylinenoint)hasattrastiter_child_nodesr   r   )nodechildcollect_body_statementsline_to_node_maps     jC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\streamlit/commands/echo.pyr   %echo.<locals>.collect_body_statementsN   sS    4((--d35(++BG$T%%>?+E2	 4       pythonzUnable to display code. )r   zast.ASTreturnNone)	streamlitr   r   r   r   	tracebackextract_stackfilenamer   open_python_file	readlinesr   parsejoinr   
end_linenotextwrapdedentFileNotFoundError)code_locationr   r   r   r   	show_codeshow_warningplaceholderframer)   
start_linesource_filesource_lines	root_nodeecho_block_start_lineecho_block_end_linelines_to_displaycode_stringerrr   r   s                      @@r   r   r   !   sY    * <;	g$$	"**(7 '')"-$~~u||/@q* ))(3{&002L 4 IIbggl34	+-	3 	3 	 	* !1 < A A! D K Ka O.z:EE'>QRoobgg.>&?@ 	 	+x(= 43@  7/u5667sH   7E.A	E D;B$E :E.;
E	E 
E+E&!E.&E++E.c                :    U  H  n[        U5      nUc  M  Us  $    g)z]Return the indent of the first non-empty line in the list.
If all lines are empty, return 0.
r   )_get_indent)lineslineindents      r   _get_initial_indentrE   k   s(     T"M 
 r!   c                    [         R                  U 5      b  g[        R                  U 5      nUb  UR                  5       $ S$ )zGet the number of whitespaces at the beginning of the given line.
If the line is empty, or if it contains just whitespace and a newline,
return None.
Nr   )_EMPTY_LINE_REmatch
_SPACES_REend)rC   rH   s     r   rA   rA   w   s>    
 D!-T"E+599;22r!   )above)r2   zLiteral['above', 'below']r$   zGenerator[None, None, None])rB   zIterable[str]r$   r   )rC   strr$   z
int | None)
__future__r   r   
contextlibrer/   r'   typingr   r   r   r   streamlit.runtime.metrics_utilr   collections.abcr	   r
   compilerI   rG   contextmanagerr   rE   rA    r!   r   <module>rV      s    # 
  	   4 4 93ZZ
H% /6E7,E7 E7  E7P		3r!   