+
    id                        R t ^ RIHt ^ RIt^ RIHt ^ RIHt ^ RIHt ^ RIH	t	 ^ RIH
t
 ^ RIHt ^ R	IHt ^ R
IHt ^ RIHt ^ RIHt ^RIHt ^RIHt ^RIHt ]! R]R]3,          R7      t ! R R]4      t ! R R]4      t ! R R4      tR# )z7State tracking utilities used by :class:`_orm.Session`.)annotationsN)Enum)Any)Callable)cast)Iterator)NoReturn)Optional)Tuple)TypeVar)Union)exc)util)Literal_F.)boundc                      ] tR t^tRtR# )_StateChangeState N)__name__
__module____qualname____firstlineno____static_attributes__r       څC:\Users\petid\OneDrive\Desktop\Maestro\MAESTRO CLAUDE\MAESTRO\maestro-backend\venv\Lib\site-packages\sqlalchemy\orm\state_changes.pyr   r      s    r   r   c                  "    ] tR t^#t^t^t^tRtR# )_StateChangeStatesr   N)r   r   r   r   ANY	NO_CHANGECHANGE_IN_PROGRESSr   r   r   r   r   r   #   s    
CIr   r   c                      ] tR t^)t$ Rt]P                  tR]R&   ]P                  t
R]R&   RtR]R&   R R	 lt]R
 R l4       t]P                   R R l4       tRtR# )_StateChangea  Supplies state assertion decorators.

The current use case is for the :class:`_orm.SessionTransaction` class. The
:class:`_StateChange` class itself is agnostic of the
:class:`_orm.SessionTransaction` class so could in theory be generalized
for other systems as well.

r   _next_state_stateNzOptional[Callable[..., Any]]_current_fnc               $    V ^8  d   QhRRRRRR/# )   operation_namestrstater   returnr   r   )formats   "r   __annotate___StateChange.__annotate__7   s$     
 
!
*;
	
r   c                	@    \         P                  ! R V RV: 2RR7      h)Can't run operation 'z()' when Session is in state iscecode)sa_excIllegalStateChangeError)selfr(   r*   s   &&&r   _raise_for_prerequisite_state*_StateChange._raise_for_prerequisite_state7   s1     ,,#N#3 4 )%
 	
r   c               $    V ^8  d   QhRRRRRR/# )r'   prerequisite_stateszEUnion[Literal[_StateChangeStates.ANY], Tuple[_StateChangeState, ...]]moves_tor   r+   zCallable[[_F], _F]r   )r,   s   "r   r-   r.   A   s/     j j
j
 $j 
jr   c                   aaaa V'       g   Q R4       hV\         P                  Jo\        RV4      oS\         P                  Jo\        P
                  R VVVV3R ll4       pV# )a  Method decorator declaring valid states.

:param prerequisite_states: sequence of acceptable prerequisite
 states.   Can be the single constant _State.ANY to indicate no
 prerequisite state

:param moves_to: the expected state at the end of the method, assuming
 no exceptions raised.   Can be the constant _State.NO_CHANGE to
 indicate state should not change at the end of the method.

zno prerequisite states sentzTuple[_StateChangeState, ...]c          
     ,    V ^8  d   QhRRRRRRRRRR/# )r'   fnr   r6   r   argkwr+   r   )r,   s   "r   r-   1_StateChange.declare_states.<locals>.__annotate__^   s6     K	/ K	/B K	/c K	/ K	/C K	/C K	/r   c                @  < VP                   pS
'       d$   VS9  d   VP                  V P                  V4       VP                  pVP                  pS	'       d   SMTpV\
        P                  Jd   S	'       d   WWJd   V'       d\   V\
        P                  \
        P                  39   d7   \        P                  ! R V P                   RVP                   RS: 2RR7      h\        P                  ! RV P                   RS: RV: 2RR7      hWn        \
        P                  Vn         V ! V.VO5/ VB pVP                   VJ d   VWQn        Wan        # VP                   VJ d+   \        P                  ! R V P                   RS: R	2RR7      hV'       dA   \        P                  ! R
VP                   RV P                   RVP                   : 2RR7      h\        P                  ! R V P                   RVP                   : 2RR7      h   h ; i  YQn        Yan        i ; i)zMethod 'z"()' can't be called here; method 'zN()' is already in progress and this would cause an unexpected state change to r1   r2   r0   z()' here; will move to state z where we are expecting z()' failed to change state to z as expectedzWhile method 'z()' was running, method 'z)()' caused an unexpected state change to )r$   r7   r   r#   r%   r   r   r   r    r4   r5   )r>   r6   r?   r@   current_state
next_stateexisting_fnexpect_state	ret_valueexpect_state_changehas_prerequisite_statesr;   prerequisite_state_collections   &&*,     r   _go(_StateChange.declare_states.<locals>._go]   s6    KKM (!)FF222;;N))J**K':8L "4"8"88'2:&00&992 $ !88"2;;- 0##.#7#7"8 9++3,8 $  !88/} =..6\ :%%/N4 $	   "1DDD!/t0c0R0	 ;;,.$4 $. #. 3 ;;-/ 88"2;;- 0&\7 $	  ! 88()=)=(> ?##%;;- 0++/;;/	;
 $  !88"2;;- 0++/;;/;# /: $. #. s,   *H	 6H AH A3H 	HH H)r   r   r   r   r   	decorator)clsr:   r;   rK   rH   rI   rJ   s   &&f @@@r   declare_states_StateChange.declare_states@   su    & #A$AA"'9'='== 	  )-+-@)
% '.@.J.JJ	K	/ K	/ 
K	/Z 
r   c                    V ^8  d   QhRRRR/# )r'   expectedr   r+   zIterator[Any]r   )r,   s   "r   r-   r.      s     E E&7 EM Er   c              #  F  "   V P                   \        P                  J g   Q R4       hWn          Rx  V P                  VJd'   \        P
                  ! RV P                  : 2RR7      h \        P                  T n         R#    h ; i  \        P                  T n         i ; i5i)zhcalled within a method that changes states.

method must also use the ``@declare_states()`` decorator.

zAUnexpected call to _expect_state outside of state-changing methodNzUnexpected state change to r1   r2   )r#   r   r    r$   r4   r5   )r6   rR   s   &&r   _expect_state_StateChange._expect_state   s      #5#H#HH 	
$	
H
 $
	E {{(*441$++A  +
  2DDD	  2DDDs-   ,B!B 6B *B!BB BB!)r%   r#   )r   r   r   r   __doc__r   r   r#   __annotations__r   r$   r%   r7   classmethodrO   
contextlibcontextmanagerrT   r   r   r   r   r"   r"   )   sn     &8%;%;K"; 2 < <F<04K-4
 j jX E Er   r"   )rV   
__future__r   rY   enumr   typingr   r   r   r   r   r	   r
   r   r    r   r4   r   util.typingr   r   r   r   r"   r   r   r   <module>r`      ss    > "              !T#s(+,	 	* [E [Er   