o
    >h                     @   s$   d dl Z d dlZdd Zdd ZdS )    Nc                 C   s   t | drt | drdS t| jd | jj S t | drVt | dr:t| tjtjfs:| j	t
ur:t| j	t
s:t| j	S t | drId| jj| jjf S t | d	rVd| j| jf S t | dr`t| j	S t| S )
zJ
    Returns either the function/class path or just the object's repr
    im_class
mock_callsz<mock>.__name__	__class____self__z%s.%s
__module__)hasattrname_that_thingr   im_func	func_name
isinstancetypesFunctionType
MethodTyper   type
issubclassr   r   r   repr)thing r   n/var/www/vedio/testing/chatpythonscript.ninositsolution.com/env/lib/python3.10/site-packages/channels/utils.pyr
      s"   







r
   c                    s   dd | D }z/	 t j|t jdI dH  t|D ]\}}| r6| }||I dH  t | |  ||< qq
|D ]}|  z|I dH  W q: t jyQ   Y q:w w )z
    Given a set of consumer callables, awaits on them all and passes results
    from them to the dispatch awaitable as they come in.
    c                 S   s   g | ]}t | qS r   )asyncioensure_future).0consumer_callabler   r   r   
<listcomp>&   s    
z'await_many_dispatch.<locals>.<listcomp>T)return_whenN)	r   waitFIRST_COMPLETED	enumeratedoneresultr   cancelCancelledError)consumer_callablesdispatchtasksitaskr!   r   r   r   await_many_dispatch    s,   r)   )r   r   r
   r)   r   r   r   r   <module>   s    