
    ii                     `    U d Z ddlZ ej        e          Zi Zeed<   d Zd Z	d Z
d Zd ZdS )	zZ
State management and query functions for tracking and discovering what
has been patched.
    Nsavedc                     | t           v S )z
    Check if a module has been replaced with a cooperative version.

    :param str mod_name: The name of the standard library module,
        e.g., ``'socket'``.

    )r   )mod_names    ?/usr/local/lib/python3.11/dist-packages/gevent/monkey/_state.pyis_module_patchedr      s     u    c                 >    t          |           o|t          |          v S )a$  
    Check if an object in a module has been replaced with a
    cooperative version.

    :param str mod_name: The name of the standard library module,
        e.g., ``'socket'``.
    :param str item_name: The name of the attribute in the module,
        e.g., ``'create_connection'``.

    )r   r   )r   	item_names     r   is_object_patchedr      s      X&&G9h+GGr   c                  *    t          t                    S )aD  
    Check if this module has done any patching in the current process.
    This is currently only used in gevent tests.

    Not currently a documented, public API, because I'm not convinced
    it is 100% reliable in the event of third-party patch functions that
    don't use ``saved``.

    .. versionadded:: 21.1.0
    )boolr    r   r   is_anything_patchedr   +   s     ;;r   c                     t                               | i           }g }d }|D ]V}||v r|                    ||                    "|t          |           }|                    t	          ||                     W|S N)r   getappend
__import__getattr)nameitemsdvaluesmoduleitems         r   _get_originalr   8   s    		$AFF 1 1199MM!D'""""~#D))MM'&$//0000Mr   c                 n    t                               | j        i                               ||           d S r   )r   
setdefault__name__)r   	attr_namer   s      r   _saver!   E   s0    	V_b))44YEEEEEr   )__doc__logging	getLoggerr   loggerr   dict__annotations__r   r   r   r   r!   r   r   r   <module>r(      s      		8	$	$ d  H H H    F F F F Fr   