
    g                    d    d dl mZ d dlZd dlmZmZmZ erd dlmZ dZ		 	 	 	 	 	 d	dZ
d
dZddZy)    )annotationsN)TYPE_CHECKINGAnycast)
Collectionz~/.snowsql/configc                J    i }| D ]  }||v s|j                  |      ||<    |S )a  Extract the specified keys from source_dict and return them in a new dict.

    Parameters
    ----------
    keys : Collection[str]
        The keys to extract from source_dict.
    source_dict : Dict[str, Any]
        The dict to extract keys from. Note that this function mutates source_dict.

    Returns
    -------
    Dict[str, Any]
        A new dict containing the keys/values extracted from source_dict.
    )pop)keyssource_dictdks       O/var/www/openai/venv/lib/python3.12/site-packages/streamlit/connections/util.pyextract_from_dictr       s4    " 	A??1%AaD  H    c                   t         j                  j                  t              }t         j                  j	                  |      si S ddl}|j                  d      }|j                  |       d|  |v r	|d|     }nd|v r|d   }ni S |j                         D ci c]'  \  }}|j                  dd      |j                  d	      ) }}}d
|v r|d
   |d<   |d
= |S c c}}w )z.Loads the dictionary from snowsql config file.r   N#)inline_comment_prefixeszconnections.connectionsname "dbdatabase)ospath
expanduserSNOWSQL_CONNECTION_FILEexistsconfigparserConfigParserreaditemsreplacestrip)connection_namesnowsql_config_filer   configraw_conn_paramsr   vconn_paramss           r   load_from_snowsql_config_filer+   :   s    '',,-DE77>>-.	 &&s&CF
KK#$	o&'61 </@!AB	&	  /	 9H8M8M8O8O1		&"qwws|+8O   {"-d"3Js   ,Cc                 X    	 ddl m}  t        t         |              S # t        $ r Y yw xY w)z*Return whether this app is running in SiS.r   is_in_stored_procedureF)"snowflake.snowpark._internal.utilsr.   r   boolModuleNotFoundErrorr-   s    r   running_in_sisr2   X   s1    	
 D0233 s    	)))r
   zCollection[str]r   dict[str, Any]returnr3   )r%   strr4   r3   )r4   r0   )
__future__r   r   typingr   r   r   collections.abcr   r   r   r+   r2    r   r   <module>r:      sF   * # 	 + +*- 
(64<	r   