
    F-Phg                        d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm	Z	 ddl
Z
d	d
lmZ d	dlmZ d	dlmZ d	dlmZ edeef         Zd(dZd)dZd*dZd+d'ZdS ),z
Call loop machinery
    )annotations)	Generator)Mapping)Sequence)cast)NoReturnN   )HookImpl)HookCallError)Result)PluggyTeardownRaisedWarning	hook_implr
   	hook_namestrargsSequence[object]returnTeardownc              #  L  K   t          t           | j        |           }	 t          |           n # t          $ r t          |d           Y nw xY w	 dV }t          |d          }n'# t          $ r}t          d|          }Y d}~nd}~ww xY w	 |                    |           t          |d           n/# t          $ r Y n#t          $ r}t          || |            d}~ww xY w|
                                 n# |
                                 w xY w|                                S )zT
    backward compatibility wrapper to run a old style hookwrapper as a wrapper
    did not yieldNhas second yield)r   r   functionnextStopIteration_raise_wrapfailr   BaseExceptionsend_warn_teardown_exceptionclose
get_result)r   r   r   teardownresresultexces           O/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/pluggy/_callers.pyrun_old_style_hookwrapperr'      ss      h(:	(:D(ABBH3X 3 3 3/222223#eeT"" # # #c""#
f 	"45555        Iq999 	s]   1 AAA' '
B1BBB5 $C9 5
C!?C9 	C!
CC!!C9 9Dwrap_controllerGenerator[None, object, object]msgr   c           
     d    | j         }t          d|j        d|j         d|j         d|           )Nzwrap_controller at  :)gi_codeRuntimeErrorco_nameco_filenameco_firstlineno)r(   r*   cos      r&   r   r   8   sI     
	 B
WbjWWR^WWb>OWWRUWW      r%   r   Nonec                    d}|d|j          d|  dz  }|t          |          j         d| dz  }|dz  }t          j        t          |          d           d S )	NzGA plugin raised an exception during an old-style hookwrapper teardown.
zPlugin: z, Hook: 
z: zvFor more information see https://pluggy.readthedocs.io/en/stable/api_reference.html#pluggy.PluggyTeardownRaisedWarning   )
stacklevel)plugin_nametype__name__warningswarnr   )r   r   r%   r*   s       r&   r   r   B   s     UCBi+BBYBBBBCd1gg''!''''C  D  DCM-c22qAAAAAAr4   
hook_implsSequence[HookImpl]caller_kwargsMapping[str, object]firstresultboolobject | list[object]c                   d}g }d}	 g }	 t          |          D ]2}	 fd|j        D             }	n8# t          $ r+}
|j        D ]}|vrt          d|          |
Y d}
~
nd}
~
ww xY w|j        r6t          || |	          }t          |           |                    |           |j        ry	  |j	        |	 }t          t          dt          t          f         |          }t          |           |                    |           # t          $ r t          |d           Y 	w xY w |j	        |	 }||                    |           |r n4n# t          $ r}|}Y d}~nd}~ww xY w|r|r|d         nd}n|}t          |          D ]}	 |a	 |                    |           n_# t"          $ r=}t%          |t                    r"|j        |u r|                                 Y d}~] d}~ww xY w|                    |           |                                 n4# t          $ r}|j        }d}Y d}~d}~wt          $ r}
|
}Y d}
~
d}
~
ww xY wt          |d           n# |r|r|d         nd}n|}t          |          D ]}	 |a	 |                    |           n_# t"          $ r=}t%          |t                    r"|j        |u r|                                 Y d}~] d}~ww xY w|                    |           |                                 n4# t          $ r}|j        }d}Y d}~d}~wt          $ r}
|
}Y d}
~
d}
~
ww xY wt          |d           w xY w|||S )zExecute a call into multiple python functions/methods and return the
    result(s).

    ``caller_kwargs`` comes from HookCaller.__call__().
    TNc                     g | ]
}|         S  rH   ).0argnamerA   s     r&   
<listcomp>z_multicall.<locals>.<listcomp>_   s    UUUwM'2UUUr4   z hook call must provide argument r   r   r   )reversedargnamesKeyErrorr   hookwrapperr'   r   appendwrapperr   r   r   objectr   r   r   throwr/   
isinstance	__cause__r   r   value)r   r?   rA   rC   __tracebackhide__results	exception	teardownsr   r   r%   rJ   function_genr"   r$   r#   r!   resis     `                r&   
_multicallr^   L   s    GIJ:$&	#	%j11  "  "	%UUUU)BTUUUDD % % %#,#5 % %"-77"/ N7 N N# ##$% 8% % % % %% ( "#<Y	SW#X#XL&&&$$\2222& "G 1i0$7'+IdFF6J,KS'Q'Q\***!((6666( G G G'oFFFFFG -),d3Cs+++& "!E 	 	 	IIIIII	  	#*4WQZZFFF !++ 	: 	:H(" y1111' 
" 
" 
" 'y-@@" "	 9 9$NN,,,$HHHH!
" MM&)))          	    	 H&89999;	:  	#*4WQZZFFF !++ 	: 	:H(" y1111' 
" 
" 
" 'y-@@" "	 9 9$NN,,,$HHHH!
" MM&)))          	    	 H&89999;	:> sE  I E 3E 
A(!A#E #A((AE 0ADE D%!E $D%%*E I 
E&E!I !E&&I HF%$H%
G,/2G'!H&G''G,,,H
I
#	H11I
>II
#MLJL
K#	&2K	LMK	K#	#,LM
M		L(	#M(M	5L<	7M<M	M)r   r
   r   r   r   r   r   r   )r(   r)   r*   r   r   r   )r   r   r   r
   r%   r   r   r5   )
r   r   r?   r@   rA   rB   rC   rD   r   rE   )__doc__
__future__r   collections.abcr   r   r   typingr   r   r=   _hooksr
   _resultr   r   	_warningsr   rR   r   r'   r   r   r^   rH   r4   r&   <module>rf      sE    # " " " " " % % % % % % # # # # # # $ $ $ $ $ $                    " " " " " "       2 2 2 2 2 2
 T66)*   >   B B B B] ] ] ] ] ]r4   