
    
`iY                     @    d dl mZ d Zd Z G d de          Zd ZdS )    wrapsc                 <     t                      fd            }|S )z
    Wraps a generator which is intended to be used as a pure coroutine by
    .send()ing it values. The only thing that the wrapper does is calling
    .next() for the first time which is required by Python generator protocol.
    c                  6     | i |}t          |           |S )N)next)argskwargsgfuncs      _/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/ijson/utils.pywrapperzcoroutine.<locals>.wrapper   s'    D$!&!!Q    r   )r   r   s   ` r   	coroutiner      s5     4[[    [ Nr   c                 4    | }|D ]\  }}} ||g|R i |}|S )aT  
    Chains together a sink and a number of coroutines to form a coroutine
    pipeline. The pipeline works by calling send() on the coroutine created with
    the information in `coro_pipeline[-1]`, which sends its results to the
    coroutine created from `coro_pipeline[-2]`, and so on, until the final
    result is sent to `sink`.
     )sinkcoro_pipelinef	coro_func	coro_argscoro_kwargss         r   chainr      sE     	A-: 4 4)	9kIa3)333{33Hr   c                        e Zd ZdZej        ZdS )sendable_lista[  
    A list that mimics a coroutine receiving values.

    Coroutine are sent values via their send() method. This class defines such a
    method so that values sent into it are appended into the list, which can be
    inspected later. As such, this type can be used as an "accumulating sink" in
    a pipeline consisting on many coroutines.
    N)__name__
__module____qualname____doc__listappendsendr   r   r   r   r   !   s!          ;DDDr   r   c              '   d  K   t                      }t          |g|R  }	 | D ]_}	 |                    |           n8# t          $ r+}|D ]}|V  t	          |t
                    rY d}~ dS  d}~ww xY w|D ]}|V  |dd= `dS # t          $ r" 	 |                                 Y dS #  Y Y dS xY ww xY w)z
    A utility function that returns a generator yielding values dispatched by a
    coroutine pipeline after *it* has received values coming from `source`.
    N)r   r   r!   	Exception
isinstanceStopIterationGeneratorExitclose)sourcer   eventsr   valueexevents          r   	coros2genr-   -   s'     
 __Ff%}%%%A 	 	Eu   #    EKKKKb-00 FFFFFF    qqq			 	    	GGIIIIII	DDD	sO   B :B 
A/A*"B )A**A//B 
B/B%%B+'B/+B/N)	functoolsr   r   r   r   r   r-   r   r   r   <module>r/      sx             	 	 	 	 	D 	 	 	    r   