+
    Bi&                     D  a  R t0 t R t^ RIt^ RIt^ RIHtHtHtHt / t	] ^ k RR R llt
R tR t]! 4       tR t ! R R	4      t ! R
 R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t]! R4      tR R ltR# )z!Dynamic class-creation for Motor.N)AnyCallableDictTypeVarc                $    V ^8  d   QhR\         /# )   sync_method)r   )formats   "S/var/www/html/photoedit/myenv/lib/python3.14/site-packages/motor/metaprogramming.py__annotate__r      s     C C C    c                   a aa \         P                  ! S4      V VV3R l4       pVe   S P                  WS4      pRVn        RVn        SP
                  pWen        Ve   W%n        V# )a  Decorate `sync_method` so it returns a Future.

The method runs on a thread and resolves the Future when it completes.

:Parameters:
 - `motor_class`:       Motor class being created, e.g. MotorClient.
 - `framework`:         An asynchronous framework
 - `sync_method`:       Unbound method of pymongo Collection, Database,
                        MongoClient, etc.
 - `doc`:               Optionally override sync_method's docstring
 - `wrap_class`:        Optional PyMongo class, wrap a returned object of
                        this PyMongo class in the equivalent Motor class
 - `unwrap_class`       Optional Motor class name, unwrap an argument with
                        this Motor class name and pass the wrapped PyMongo
                        object instead
c           	      2  < S
e   V Uu. uF>  pVP                   P                  P                  S
R34      '       d   VP                  MTNK@  	  ppVP	                  4        UUu/ uFA  w  rSTVP                   P                  P                  S
R34      '       d   VP                  MTbKC  	  pppMV Uu. uF<  pVP                   P                  P                  R4      '       d   VP                  MTNK>  	  ppVP	                  4        UUu/ uF?  w  rSTVP                   P                  P                  R4      '       d   VP                  MTbKA  	  pppV P                  4       pSP                  ! VS	V P                  .VO5/ VB # u upi u uppi u upi u uppi )NMotorClientSession)	__class____name__endswithdelegateitemsget_io_looprun_on_executor)selfargskwargsobjunwrapped_argskeyunwrapped_kwargsloop	frameworkr   unwrap_classs   &*,     r
   methodasynchronize.<locals>.method+   s   #  	  C ==))22LBV3WXX   	   !'  !/HC }}--66FZ7[\\ LL
 !/     C !$ 6 6 ? ?@T U U[^^   !'	  !/HC $'MM$:$:$C$CDX$Y$YCLL_bc !/	    !((+t}}
/=
AQ
 	
9  s$   1FF#AF2/F"F	AFT)	functoolswrapspymongo_class_wrapperis_wrap_methodis_async_methodr   pymongo_method_name__doc__)r   r   doc
wrap_classr    r!   names   ff&&f  r
   asynchronizer-      sk    $ __[!!
 "!
F 00D $ "FD!%
Mr   c                     R  V  4       # )c              3      "   T F>  pVP                   P                  P                  R 4      '       d   VP                  MTx  K@  	  R# 5i)r   N)r   r   r   r   ).0r   s   & r
   	<genexpr>&unwrap_args_session.<locals>.<genexpr>`   s<      C ..778LMMSVVs
   /AA )r   s   &r
   unwrap_args_sessionr4   _   s     r   c                     V P                  4        UUu/ uF>  w  rYP                  P                  P                  R 4      '       d   VP                  MTbK@  	  upp# u uppi )r   )r   r   r   r   r   )r   r   r   s   &  r
   unwrap_kwargs_sessionr6   f   sV     &HC 	mm44==>RSScllY\\&  s   AAc                    RV n         V # )zdIn docs, annotate a function that returns a Future with 'coroutine'.

This doesn't affect behavior.
T)coroutine_annotation)fs   &r
   r8   r8   p   s     "AHr   c                   4   a  ] tR t^}t o RtRR ltR tRtV tR# )MotorAttributeFactoryzUsed by Motor classes to mark attributes that delegate in some way to
PyMongo. At module import time, create_class_with_framework calls
create_attribute() for each attr to create the final class attribute.
Nc                    Wn         R # Nr*   r   r*   s   &&r
   __init__MotorAttributeFactory.__init__   s    r   c                    \         hr=   )NotImplementedError)r   cls	attr_names   &&&r
   create_attribute&MotorAttributeFactory.create_attribute   s    !!r   r>   r=   )	r   
__module____qualname____firstlineno__r)   r@   rF   __static_attributes____classdictcell____classdict__s   @r
   r;   r;   }   s     
" "r   r;   c                   H   a a ] tR t^t oRV 3R lltR tR tR tRtVt	V ;t
# )Asyncc                N   < \         SV `  V4       Wn        RV n        RV n        R# )a  A descriptor that wraps a PyMongo method, such as insert_one,
and returns an asynchronous version of the method that returns a Future.

:Parameters:
 - `attr_name`: The name of the attribute on the PyMongo class, if
   different from attribute on the Motor class
N)superr@   rE   r+   r    )r   rE   r*   r   s   &&&r
   r@   Async.__init__   s&     	" r   c                    V P                   ;'       g    Tp\        VP                  V4      p\        VP                  VV P
                  V P                  V P                  R 7      # ))r   r   r*   r+   r    )rE   getattr__delegate_class__r-   
_frameworkr*   r+   r    )r   rD   rE   r,   r!   s   &&&  r
   rF   Async.create_attribute   sS    ~~**//6nn**
 	
r   c                    Wn         V # r=   r+   r   original_classs   &&r
   wrap
Async.wrap       (r   c                    Wn         V # r=   )r    )r   
class_names   &&r
   unwrapAsync.unwrap   s    &r   )rE   r    r+   r=   )r   rH   rI   rJ   r@   rF   r]   rb   rK   rL   __classcell__)r   rN   s   @@r
   rP   rP      s     !	
 r   rP   c                   *   a  ] tR t^t o RR ltRtV tR# )	AsyncReadNc                4    \         P                  WVR7       R# )zUA descriptor that wraps a PyMongo read method like find_one() that
returns a Future.
rE   r*   NrP   r@   r   rE   r*   s   &&&r
   r@   AsyncRead.__init__        	tc:r   r3   NNr   rH   rI   rJ   r@   rK   rL   rM   s   @r
   rf   rf           ; ;r   rf   c                   *   a  ] tR t^t o RR ltRtV tR# )
AsyncWriteNc                4    \         P                  WVR7       R# )zyA descriptor that wraps a PyMongo write method like update_one() that
accepts getLastError options and returns a Future.
rh   Nri   rj   s   &&&r
   r@   AsyncWrite.__init__   rl   r   r3   rm   rn   rM   s   @r
   rq   rq      ro   r   rq   c                   *   a  ] tR t^t o RR ltRtV tR# )AsyncCommandNc                4    \         P                  WVR7       R# )zA descriptor that wraps a PyMongo command like copy_database() that
returns a Future and does not accept getLastError options.
rh   Nri   rj   s   &&&r
   r@   AsyncCommand.__init__   rl   r   r3   rm   rn   rM   s   @r
   ru   ru      ro   r   ru   c                   *   a  ] tR t^t o RtR tRtV tR# )ReadOnlyPropertyz;Creates a readonly attribute on the wrapped PyMongo object.c                   a V3R  lpV P                   '       d   V P                   pM \        VP                  S4      P                  pV'       d   \	        W4R7      # \	        VR7      # )c                 0   < \        V P                  S4      # r=   )rU   r   )r   rE   s   &r
   fget/ReadOnlyProperty.create_attribute.<locals>.fget   s    3<<33r   )r|   r*   )r|   )r*   rU   rV   r)   property)r   rD   rE   r|   r*   s   &&f  r
   rF   !ReadOnlyProperty.create_attribute   sM    	4 888((C#00)<DDC//&&r   r3   N)r   rH   rI   rJ   r)   rF   rK   rL   rM   s   @r
   ry   ry      s     E' 'r   ry   c                   :   a  ] tR t^t o RtRR ltR tR tRtV t	R# )DelegateMethodzWA method on the wrapped PyMongo object that does no I/O and can be called
synchronouslyNc                >    \         P                  W4       R V n        R # r=   )ry   r@   r+   r?   s   &&r
   r@   DelegateMethod.__init__   s    !!$,r   c                    Wn         V # r=   rZ   r[   s   &&r
   r]   DelegateMethod.wrap   r_   r   c                *  aa V P                   f   \        P                  WV4      # \        VP                  V4      oV P                   o\
        P                  ! S4      VV3R l4       pV P                  '       d   V P                  Vn        RVn	        V# )Nc                 x   < S! V P                   .VO5/ VB pVP                  S8X  d   V P                  V4      # V# r=   )r   r   r]   )self_r   r   resultr!   r\   s   &*, r
   wrapper0DelegateMethod.create_attribute.<locals>.wrapper   s?    ENN<T<V<F >1zz&))r   T)
r+   ry   rF   rU   rV   r#   r$   r*   r)   r&   )r   rD   rE   r   r!   r\   s   &&& @@r
   rF   DelegateMethod.create_attribute   sy    ??"#44T	JJ//;		 	 
!	 888"hhGO!%r   rZ   r=   )
r   rH   rI   rJ   r)   r@   r]   rF   rK   rL   rM   s   @r
   r   r      s      r   r   c                   &   a  ] tR t^t o R tRtV tR# )MotorCursorChainingMethodc                   a \        VP                  V4      o\        P                  ! S4      V3R  l4       pRVn        W#n        V P                  '       d   V P                  Vn        V# )c                 4   < S! V P                   .VO5/ VB  V # r=   )r   )r   r   r   cursor_methods   &*,r
   return_clone@MotorCursorChainingMethod.create_attribute.<locals>.return_clone   s    $--9$9&9Kr   T)rU   rV   r#   r$   is_motorcursor_chaining_methodr(   r*   r)   )r   rD   rE   r   r   s   &&& @r
   rF   *MotorCursorChainingMethod.create_attribute   s[     6 6	B		'	 
(	
 7;3+4(888#'88L r   r3   N)r   rH   rI   rJ   rF   rK   rL   rM   s   @r
   r   r      s      r   r   Tc                H    V ^8  d   QhR\         R\        R\        R\         /# )r   rD   r   module_namereturn)r   r   str)r	   s   "r
   r   r     s(      Q 3 S Q r   c                    VP                   V P                  ,           pWV3p\        P                  V4      pV'       d   V# \	        \        V4      V 3/ 4      pW&n        Wn        \        VR 4      '       g   Q h\        \        P                  ! V 4      4       F[  pVP                  P                  4        F:  w  r\        V	\        4      '       g   K  V	P!                  Wh4      p
\#        WhV
4       K<  	  K]  	  V\        V&   V# )rV   )CLASS_PREFIX__motor_class_name___class_cachegettyper   rH   rW   hasattrreversedinspectgetmro__dict__r   
isinstancer;   rF   setattr)rD   r   r   motor_class_name	cache_keycached_class	new_classbaser,   attrnew_class_attrs   &&&        r
   create_class_with_frameworkr     s     --0H0HH	2I##I.LS)*SFB7I&$923333 ,-----/JD$ 566!%!6!6y!G	8 0 . (Lr   c                b    V ^8  d   Qh/ ^ \         9   d   \        \        \        3,          ;R&   # )r   r   )__conditional_annotations__r   r   )r	   s   "r
   r   r      s"     ' '
 " !d38n ! (r   )NNN)r   r)   r#   r   typingr   r   r   r   r   r-   r4   r6   object_coro_tokenr8   r;   rP   rf   rq   ru   ry   r   r   r   r   r   )r   s   @r
   <module>r      s    (   / /! !
CL h

" 
"! D; ;; ;;5 ;', '$"% "J 5 $ CLr   