
    \j                         d Z ddlmZ ddlmZ ddlmZ ddl ddl	 eZ
 ed      Zg dZ	 d	Zd
ad
a e       adefdZdefdZd ZeeeefZg dZy
)zR
The ldclient module contains the most common top-level entry points for the SDK.
    )ReadWriteLock)log)VERSION   )*l   )	keyipcountryemail	firstNamelastNameavatarname	anonymous   Nconfigc                 ,   	 t         j                          t        rHt        j                  dt
        z   dz          t        | t              }t        }|a|j                          | a	t         j                          y# | a	t         j                          w xY w)a  Sets the configuration for the shared SDK client instance.

    If this is called prior to :func:`ldclient.get()`, it stores the configuration that will be used when the
    client is initialized. If it is called after the client has already been initialized, the client will be
    re-initialized with the new configuration (this will result in the next call to :func:`ldclient.get()`
    returning a new client instance).

    :param config: the client configuration
    z#Reinitializing LaunchDarkly Client z with new configr   
start_waitN)__locklock__clientr   infor   LDClientr   close__configunlock)r   
new_client
old_clients      ;/root/env/lib/python3.12/site-packages/ldclient/__init__.py
set_configr!      sm    
HH:WDGYYZ!JGJ!J!H s   A"A; ;Breturnc                     	 t         j                          t        rt        t         j                          S t        t        d      	 t         j                          	 t         j                          t        s1t        j                  dt        z          t        t        t              at        t         j                          S # t         j                          w xY w# t         j                          w xY w)a7  Returns the shared SDK client instance, using the current global configuration.

    To use the SDK as a singleton, first make sure you have called :func:`ldclient.set_config()`
    at startup time. Then ``get()`` will return the same shared :class:`ldclient.client.LDClient`
    instance each time. The client will be initialized if it has not been already.

    If you need to create multiple client instances with different configurations, instead of this
    singleton approach you can call the :class:`ldclient.client.LDClient` constructor directly instead.
    zset_config was not calledz!Initializing LaunchDarkly Client r   )r   rlockr   runlockr   	Exceptionr   r   r   r   r   r   r        r    getr)   4   s     	 788  	HH87BCxJGH 	 	s   C C AC CC1c                      	 t         j                          t        } d at         j                          | r| j	                          y y # t         j                          w xY w)N)r   r   r   r   r   )cs    r    _reset_clientr,   U   sA    		 	 	s   A A)
ConfigContextContextBuilderContextMultiBuilderr   clientcontext
evaluationintegrations
interfaces)__doc__ldclient.impl.rwlockr   _ReadWriteLockldclient.impl.utilr   ldclient.versionr   r1   r2   __version__float__LONG_SCALE____BUILTINS__r   r   r   r   r-   r!   r   r)   r,   strintbool__BASE_TYPES____all__r'   r(   r    <module>rD      s    A " $  ()H 
		v 4X B
 uc4(r(   