U
    ˜ARdÚ  ã                   @   sT   d dl Z d dlmZ d dlZd dlmZmZ d dlmZ edƒeddœdd„ƒZ	dS )	é    N)ÚAny)Ú	code_utilÚstring_util)Úgather_metricsZexperimental_show)ÚargsÚreturnc               
   G   s$  | sdS zÆddl }| ¡ }|dkr2t d¡ W dS |jdk	r\|jjdk	r\| |jj¡d }nd}|stt d¡ W dS |d  dd¡d }t | |¡}t	|ƒD ].\}}t
 |¡}t d| ¡ t | | ¡ qœW nP tk
r }	 z0t ¡ \}
}}|dkrtdƒ|	‚t |¡ W 5 d}	~	X Y nX dS )	aR  Write arguments and *argument names* to your app for debugging purposes.

    Show() has similar properties to write():

        1. You can pass in multiple arguments, all of which will be debugged.
        2. It returns None, so it's "slot" in the app cannot be reused.

    Note: This is an experimental feature. See
    https://docs.streamlit.io/library/advanced-features/prerelease#experimental for more information.

    Parameters
    ----------
    *args : any
        One or many objects to debug in the App.

    Example
    -------
    >>> import streamlit as st
    >>> import pandas as pd
    >>>
    >>> dataframe = pd.DataFrame({
    ...     'first column': [1, 2, 3, 4],
    ...     'second column': [10, 20, 30, 40],
    ... })
    >>> st.experimental_show(dataframe)

    Notes
    -----
    This is an experimental feature with usage limitations:

    - The method must be called with the name `show`.
    - Must be called in one line of code, and only once per line.
    - When passing multiple arguments the inclusion of `,` or `)` in a string
        argument may cause an error.

    Nr   z`show` not enabled in the shellé   Úshowé   z**%s**z€Unexpected state: exc was None. If you see this message, please create an issue at https://github.com/streamlit/streamlit/issues)ÚinspectÚcurrentframeÚstÚwarningÚf_backÚgetframeinfoÚsplitr   Zget_method_args_from_codeÚ	enumerater   Zescape_markdownZmarkdownÚwriteÚ	ExceptionÚsysÚexc_infoÚRuntimeErrorÚ	exception)r   r   Úcurrent_frameÚlinesÚlineÚinputsÚidxÚinputÚescapedZ
raised_excÚ_ÚexcÚexc_tb© r#   ú;/tmp/pip-unpacked-wheel-b9et7o5g/streamlit/elements/show.pyr	      s:    &



ÿür	   )
r   Útypingr   Z	streamlitr   r   r   Zstreamlit.runtime.metrics_utilr   r	   r#   r#   r#   r$   Ú<module>   s   