
    /_i                    `    d dl mZ d dlZd dl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)
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       Y/var/www/html/land_sniper/venv/lib/python3.12/site-packages/streamlit/connections/util.pyextract_from_dictr       s9    " 	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041		&"qwws|+K  {"-d"3Js   ,Cc                 <    	 ddl m}   |        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-   ModuleNotFoundErrorr,   s    r   running_in_sisr0   X   s)    	
 &'' s    	)r	   zCollection[str]r
   dict[str, Any]returnr1   )r$   strr2   r1   )r2   bool)
__future__r   r   typingr   r   collections.abcr   r   r   r*   r0    r   r   <module>r9      sC   * # 	 %*- 
(64<	r   