
    %`i                         d Z ddlZddlZddlmZ ddlmZ 	 ddlZn# e$ r dZY nw xY wd Z	d Z
defdZ ed	
          dedefd            Z ed	
          d             ZdS )zj
This file should only be imported from Python 3.
It will raise SyntaxError when importing from Python 2.
    N)	lru_cache)env_boolc                  |    t           r#t          dd          rt          j                    S t          j                    S )zKConstruct a new event loop. Ray will use uvloop if it exists and is enabledRAY_USE_UVLOOPT)uvloopr   new_event_loopasyncio     m/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/ray/_private/async_compat.pyget_new_event_loopr      s:     ((+T22 ($&&&%'''r   c                  ^    t           r%t          dd          rt          j                     dS dS )zSInstalls uvloop as event-loop implementation for asyncio (if available and enabled)r   TN)r   r   installr
   r   r   try_install_uvloopr      s5     (+T22 r   returnc                 R    t          j        |           pt          j        |           S )zBReturn True if the function is an async or async generator method.)inspectiscoroutinefunctionisasyncgenfunction)funcs    r   is_async_funcr   !   s#    &t,,P0J40P0PPr   i   )maxsizeclsc                 Z    t          t          j        | t                              dk    S )z/Return True if the class has any async methods.)	predicater   )lenr   
getmembersr   )r   s    r   has_async_methodsr   &   s'     w!#???@@1DDr   c                 4     t                     r S  fd}|S )z-Wrap a blocking function in an async functionc                     K    | i |S )Nr
   )argskwargsr   s     r   wrapperzsync_to_async.<locals>.wrapper3   s      tT$V$$$r   )r   )r   r#   s   ` r   sync_to_asyncr$   ,   s:     T % % % % % Nr   )__doc__r	   r   	functoolsr   ray._private.ray_constantsr   r   ImportErrorr   r   boolr   objectr   r$   r
   r   r   <module>r+      s.            / / / / / /MMMM   FFF( ( (  Q4 Q Q Q Q
 5E6 Ed E E E E
 5	 	 	 	 	s    ''