o
    tPf                     @   s   d Z ddlmZ ddlmZ ddlmZ ddlZg dZdeejvs%J G dd	 d	ejZ	e	 Z
dad
d Zdd Zdd Zdd Zdd Zdd Zdd Zdd ZddlmZ ee d dS )z"
Maintains the thread local hub.

    )absolute_import)division)print_functionN)get_hubget_hub_noargsget_hub_if_existsgeventc                       s   e Zd Z fddZ  ZS )_Threadlocalc                    s$   t t|   d | _d | _d | _d S N)superr	   __init__Hubloophub)self	__class__ R/var/www/html/humari/django-venv/lib/python3.10/site-packages/gevent/_hub_local.pyr      s   
z_Threadlocal.__init__)__name__
__module____qualname__r   __classcell__r   r   r   r   r	      s    r	   c                  C   s   t j} | du rt } t _| S )zReturn the type of hub to use for the current thread.

    If there's no type of hub for the current thread yet, 'gevent.hub.Hub' is used.
    N)_threadlocalr   hubtyper   r   r   get_hub_class=   s   
r   c                 C   s   | a d S r
   )r   r   r   r   r   set_default_hub_classG   s   r   c                  C   s@   zt j} W n ty   d} Y nw | du rt }|  } t _| S )a  
    Return the hub for the current thread.

    If a hub does not exist in the current thread, a new one is
    created of the type returned by :func:`get_hub_class`.

    .. deprecated:: 1.3b1
       The ``*args`` and ``**kwargs`` arguments are deprecated. They were
       only used when the hub was created, and so were non-deterministic---to be
       sure they were used, *all* callers had to pass them, or they were order-dependent.
       Use ``set_hub`` instead.

    .. versionchanged:: 1.5a3
       The *args* and *kwargs* arguments are now completely ignored.

    .. versionchanged:: 23.7.0
       The long-deprecated ``args`` and ``kwargs`` parameters are no
       longer accepted.
    Nr   r   AttributeErrorr   r   r   r   r   r   r   K   s   
r   c                  C   s@   zt j} W n ty   d } Y nw | d u rt }|  } t _| S r
   r   r    r   r   r   r   k   s   
r   c                   C   s   zt jW S  ty   Y dS w )ze
    Return the hub for the current thread.

    Return ``None`` if no hub has been created yet.
    N)r   r   r   r   r   r   r   r   v   s
   	r   c                 C   
   | t _d S r
   )r   r   )r   r   r   r   set_hub      
r"   c                   C   s   t jS r
   r   r   r   r   r   r   get_loop   s   r%   c                 C   r!   r
   r$   )r   r   r   r   set_loop   r#   r&   )import_c_accelzgevent.__hub_local)__doc__
__future__r   r   r   _thread__all__str_localr	   r   r   r   r   r   r   r   r"   r%   r&   gevent._utilr'   globalsr   r   r   r   <module>   s(   
 
 