
    F	hY                     8    d dl mZ d Zd Z G d de      Zd Zy)    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                  .     | i |}t        |       |S )N)next)argskwargsgfuncs      F/var/www/html/backend/venv/lib/python3.12/site-packages/ijson/utils.pywrapperzcoroutine.<locals>.wrapper   s    $!&!Q    r   )r   r   s   ` r   	coroutiner      s"     4[  Nr   c                 8    | }|D ]  \  }}} ||g|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      s8     	A-: 4)	9ka3)3{34Hr   c                   (    e Zd ZdZej
                  Zy)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     ;;Dr   r   c              '   B  K   t               }t        |g| }	 | D ]$  }	 |j                  |       |D ]  }|  |dd= & y# t        $ r'}|D ]  }|  t	        |t
              rY d}~ y d}~ww xY w# t        $ r 	 |j                          Y y#  Y Y yxY ww xY w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   q		  #  EK b-0  	GGI		st   BA7 AA7 B	A4A/(A7 -B.A//A44A7 7	BBBBBBBBN)	functoolsr   r   r   r   r   r-   r   r   r   <module>r/      s#    	D 	r   