o
    oii                     @   sP   U d Z ddlZeeZi Zeed< dd Zdd Z	dd	 Z
d
d Zdd ZdS )zZ
State management and query functions for tracking and discovering what
has been patched.
    Nsavedc                 C   s   | 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_name r   S/var/www/html/pca-backend/venv/lib/python3.10/site-packages/gevent/monkey/_state.pyis_module_patched   s   r   c                 C   s   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_namer   r   r   is_object_patched   s   r   c                   C   s   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   r   r   is_anything_patched+   s   r
   c                 C   sZ   t | i }g }d }|D ]}||v r|||  q|d u r"t| }|t|| q|S N)r   getappend
__import__getattr)nameitemsdvaluesmoduleitemr   r   r   _get_original8   s   r   c                 C   s   t | ji || d S r   )r   
setdefault__name__)r   	attr_namer   r   r   r   _saveE   s   r   )__doc__logging	getLoggerr   loggerr   dict__annotations__r   r   r
   r   r   r   r   r   r   <module>   s   
