+
    8i3                    B   R t ^ RIHt ^ RIHt ^ RIHtHtHtH	t	H
t
HtHtHt ^ RIHtHt ^ RIHtHt ^ RIHt ^ RIHtHtHt ^ RIHtHtHtHt ^ R	IH t  ^ R
I!H"t"H#t#H$t$ ]'       d   ^ RI%H&t& ^ RI'H(t( ^ RI)H*t* Rt+ ! R R]]$,          4      t, ! R R],]$,          4      t-R# )z4CommandCursor class to iterate over command results.)annotations)deque)TYPE_CHECKINGAnyAsyncIteratorMappingNoReturnOptionalSequenceUnion)CodecOptions&_convert_raw_document_lists_to_streams)_AsyncCursorBase_ConnectionManager)_CURSOR_CLOSED_ERRORS)ConnectionFailureInvalidOperationOperationFailure)_GetMore_OpMsg_OpReply_RawBatchGetMore)PinnedResponse)_Address_DocumentOut_DocumentType)AsyncClientSession)AsyncCollection)AsyncConnectionFc                      ] tR t^.tRt]tR&R R lltR R ltR R lt	R	 R
 lt
]R R l4       tR R ltR'R R lltR R ltR R ltR R ltR R ltR R ltR R ltR R ltR R  ltR(R! R" lltR# R$ ltR%tR# ))AsyncCommandCursorz7An asynchronous cursor / iterator over command cursors.Nc               8    V ^8  d   QhRRRRRRRRR	R
RRRRRR/#    
collectionzAsyncCollection[_DocumentType]cursor_infozMapping[str, Any]addresszOptional[_Address]
batch_sizeintmax_await_time_msOptional[int]sessionzOptional[AsyncClientSession]commentr   returnNone )formats   "a/var/www/html/photoedit/myenv/lib/python3.14/site-packages/pymongo/asynchronous/command_cursor.py__annotate__AsyncCommandCursor.__annotate__3   sZ     ( (2( '( $	(
 ( )( .( ( 
(    c                   RV n         Wn        VR,          V n        \        VR,          4      V n        VP                  R4      V n        W0n        W@n        WPn	        V P                  P                  P                  P                  P                  V n        W`n        V P                  e   RV P                  n        V P                  ^ 8H  V n        Wpn        V P"                  '       d   V P'                  4        RV9   d   VR,          V n        MVP*                  V n        V P-                  V4       \/        V\0        4      '       g   Ve   \3        R\5        V4       24      hR# R# )zCreate a new command cursor.Nid
firstBatchpostBatchResumeTokenTnsz2max_await_time_ms must be an integer or None, not )	_sock_mgr_collection_idr   _dataget_postbatchresumetoken_address_batch_size_max_await_time_msdatabaseclientoptionstimeout_timeout_session_attached_to_cursor_killed_comment_end_session_ns	full_namer'   
isinstancer(   	TypeErrortype)selfr$   r%   r&   r'   r)   r+   r,   s   &&&&&&&&r1   __init__AsyncCommandCursor.__init__3   s'    #;Et$;|45
BM//"C
"  %"3((1188@@HH==$04DMM-xx1}<<<;"4(DH!++DH
#+S116G6SDTJ[E\D]^  7T1r4   c                   V ^8  d   QhRR/# )r#   r-   strr/   )r0   s   "r1   r2   r3   ]   s       r4   c                	    V P                   # N)rM   rR   s   &r1   _get_namespace!AsyncCommandCursor._get_namespace]   s    xxr4   c                    V ^8  d   QhRRRR/# )r#   r'   r(   r-   !AsyncCommandCursor[_DocumentType]r/   )r0   s   "r1   r2   r3   `   s      S -N r4   c                    \        V\        4      '       g   \        R\        V4       24      hV^ 8  d   \	        R4      hV^8H  ;'       d    ^;'       g    TV n        V # )aa  Limits the number of documents returned in one batch. Each batch
requires a round trip to the server. It can be adjusted to optimize
performance and limit data transfer.

.. note:: batch_size can not override MongoDB's internal limits on the
   amount of data it will return to the client in a single batch (i.e
   if you set batch size to 1,000,000,000, MongoDB will currently only
   return 4-16MB of results per batch).

Raises :exc:`TypeError` if `batch_size` is not an integer.
Raises :exc:`ValueError` if `batch_size` is less than ``0``.

:param batch_size: The size of each batch of results requested.
z#batch_size must be an integer, not zbatch_size must be >= 0)rO   r(   rP   rQ   
ValueErrorrA   )rR   r'   s   &&r1   r'   AsyncCommandCursor.batch_size`   s^     *c**A$zBRASTUU>677%?00q>>Jr4   c                   V ^8  d   QhRR/# )r#   r-   boolr/   )r0   s   "r1   r2   r3   w   s     # #4 #r4   c                2    \        V P                  4      ^ 8  # )zNReturns `True` if the cursor has documents remaining from the
previous batch.
)lenr=   rY   s   &r1   	_has_nextAsyncCommandCursor._has_nextw   s     4::""r4   c                   V ^8  d   QhRR/# )r#   r-   Optional[Mapping[str, Any]]r/   )r0   s   "r1   r2   r3   ~   s     * **E *r4   c                    V P                   # )z\Retrieve the postBatchResumeToken from the response to a
changeStream aggregate or getMore.
)r?   rY   s   &r1   _post_batch_resume_token+AsyncCommandCursor._post_batch_resume_token}   s    
 )))r4   c                    V ^8  d   QhRRRR/# )r#   connr   r-   r.   r/   )r0   s   "r1   r2   r3      s     * * *D *r4   c                	Z  "   V P                   P                  P                  pVP                  V P                  4      '       g   R # V P
                  '       gP   VP                  4        \        VR4      pV P                  ^ 8X  d   VP                  4       G R j  xL
  R # W0n        R # R #  L5iNF)
r;   rC   rD   _should_pin_cursorrH   r:   
pin_cursorr   r<   close)rR   rm   rD   conn_mgrs   &&  r1   _maybe_pin_connection(AsyncCommandCursor._maybe_pin_connection   s     !!**11((77~~~OO)$6H xx1}nn&&&!)  's   AB+A B+B)B+c               0    V ^8  d   QhRRRRRRRRR	R
RR/# )r#   responseUnion[_OpReply, _OpMsg]	cursor_idr*   codec_optionszCodecOptions[Mapping[str, Any]]user_fieldsrh   legacy_responserb   r-   zSequence[_DocumentOut]r/   )r0   s   "r1   r2   r3      sN     ` `)` !` 7	`
 1` ` 
 `r4   c                	&    VP                  W#WE4      # rX   )unpack_response)rR   rw   ry   rz   r{   r|   s   &&&&&&r1   _unpack_response#AsyncCommandCursor._unpack_response   s     ''	+__r4   c                   V ^8  d   QhRR/# )r#   r-   r.   r/   )r0   s   "r1   r2   r3      s     ! !d !r4   c                	    V P                   '       dS   V P                   P                  '       d5   R V P                   n        V P                   P                  4        RV n         R# R# R# )FN)rH   	_implicitrI   _end_implicit_sessionrY   s   &r1   rL   AsyncCommandCursor._end_session   sD    ===T]]44405DMM-MM//1 DM 5=r4   c                    V ^8  d   QhRRRR/# )r#   	operationr   r-   r.   r/   )r0   s   "r1   r2   r3      s     *& *&X *&$ *&r4   c                  "   V P                   P                  P                  p VP                  WP                  V P
                  R7      G Rj  xL
 p\        T\         4      '       d8   T P"                  '       g&   \%        TP&                  TP(                  4      T n        TP*                  '       dI   TP,                  ^ ,          R,          pTR,          pTP/                  R4      T n        TR,          T n        MITP,                  p\        TP4                  \6        4      '       g   Q hTP4                  P8                  T n        T P2                  ^ 8X  d   T P                  4       G Rj  xL
  \;        T4      T n        R#  EL0  \         d_   pTP                  \        9   d   RT n	        TP                  '       d   T P                  4        h T P                  4       G Rj  xL 
  h Rp?i\         d#    RT n	        T P                  4       G Rj  xL 
  h \         d    T P                  4       G Rj  xL 
  h i ; i L5i)z/Send a getmore message and handle the response.)r&   NTcursor	nextBatchr8   r6   )r;   rC   rD   _run_operationr   r@   r   coder   rJ   rF   _die_no_lockrr   r   	ExceptionrO   r   r:   r   rm   more_to_comefrom_commanddocsr>   r?   r<   datar   ry   r   r=   )rR   r   rD   rw   excr   	documentss   &&     r1   _send_message AsyncCommandCursor._send_message   s    !!**11	#2200$-- 3  H. h//>>>!3HMM8CXCX!Y   ]]1%h/F{+I)/4J)KD&d|DH IhmmX6666}}..DH88q=**,9%
M   		xx00#{{{!!#  jjl""  	DL**, 	**,	$ s   !H>*F E>F 'H>;6H>2B5H>'H<(H>>F H9-G%:$G%G!G%%H92H9HH9H91H42H99H>c                   V ^8  d   QhRR/# )r#   r-   r(   r/   )r0   s   "r1   r2   r3      s          r4   c                  "   \        V P                  4      '       g   V P                  '       d   \        V P                  4      # V P                  '       d   V P                  P                  R^4      w  rV P                  P                  V P                  4      pV P                  V P                  VVV P                  V P                  V P                  P                  VV P                  V P                  P                  P                  V P                   V P"                  RV P$                  4      4      G Rj  xL
  MV P'                  4       G Rj  xL
  \        V P                  4      #  L2 L5i)zRefreshes the cursor with more data from the server.

Returns the length of self._data after refresh. Will exit early if
self._data is already non-empty. Raises OperationFailure when the
cursor cannot be refreshed due to an error on the query.
.FN)rd   r=   rJ   r<   rM   splitr;   _read_preference_forr+   r   _getmore_classrA   rz   rH   rC   rD   rB   r:   rK   	_die_lock)rR   dbnamecollname	read_prefs   &   r1   _refreshAsyncCommandCursor._refresh   s     tzz??dllltzz?"888#xx~~c15F((==dllKI$$##$$HH$$22MM$$--44++NNMM  " .."""4::'" #s/   -E-&E-CE-6E)7E-E+E-+E-c                   V ^8  d   QhRR/# )r#   r-   zAsyncIterator[_DocumentType]r/   )r0   s   "r1   r2   r3      s      7 r4   c                	    V # rX   r/   rY   s   &r1   	__aiter__AsyncCommandCursor.__aiter__   s    r4   c                   V ^8  d   QhRR/# )r#   r-   r]   r/   )r0   s   "r1   r2   r3      s      "C r4   c                	   "   V # 5irX   r/   rY   s   &r1   
__aenter__AsyncCommandCursor.__aenter__   s
     s   c                   V ^8  d   QhRR/# r#   r-   r   r/   )r0   s   "r1   r2   r3      s     ! !M !r4   c                   "   V P                   '       d"   V P                  R4      G Rj  xL
 pVf   K1  V# \        h L5i)zAdvance the cursor.TN)alive	_try_nextStopAsyncIteration)rR   docs   & r1   nextAsyncCommandCursor.next   s6      jjjt,,C
  	 -s   >><>	>c                   V ^8  d   QhRR/# r   r/   )r0   s   "r1   r2   r3      s     ! ! !r4   c                	>   "   V P                  4       G R j  xL
 #  L5irX   )r   rY   s   &r1   	__anext__AsyncCommandCursor.__anext__   s     YY[   s   c                    V ^8  d   QhRRRR/# )r#   get_more_allowedrb   r-   Optional[_DocumentType]r/   )r0   s   "r1   r2   r3     s       9P r4   c                  "   \        V P                  4      '       g3   V P                  '       g!   V'       d   V P                  4       G Rj  xL
  \        V P                  4      '       d   V P                  P	                  4       # R#  L;5i)z<Advance the cursor blocking for at most one getMore command.N)rd   r=   rJ   r   popleft)rR   r   s   &&r1   r   AsyncCommandCursor._try_next  sT     4::t|||8H--/!!tzz??::%%''	 "s   -B	B	B	B<B	c               $    V ^8  d   QhRRRRRR/# )r#   resultlisttotalr*   r-   rb   r/   )r0   s   "r1   r2   r3     s!       ] d r4   c                  "   \        V P                  4      '       g+   V P                  '       g   V P                  4       G Rj  xL
  \        V P                  4      '       d   Vf8   VP	                  V P                  4       V P                  P                  4        R# \        \        \        V P                  4      V4      4       F,  pVP                  V P                  P                  4       4       K.  	  R# R#  L5i)z4Get all or some available documents from the cursor.NTF)
rd   r=   rJ   r   extendclearrangeminappendr   )rR   r   r   _s   &&& r1   _next_batchAsyncCommandCursor._next_batch  s     4::t|||--/!!tzz??}djj)

  "  s3tzz?E:;AMM$**"4"4"67 < "s   -C<C<C:B7C<c                   V ^8  d   QhRR/# )r#   r-   r   r/   )r0   s   "r1   r2   r3     s     ; ; 7 ;r4   c                B   "   V P                  RR7      G Rj  xL
 #  L5i)a"  Advance the cursor without blocking indefinitely.

This method returns the next document without waiting
indefinitely for data.

If no document is cached locally then this method runs a single
getMore command. If the getMore yields any documents, the next
document is returned, otherwise, if the getMore returns no documents
(because there is no additional data) then ``None`` is returned.

:return: The next document or ``None`` when no document is available
  after running a single getMore or when the cursor is closed.

.. versionadded:: 4.5
T)r   N)r   rY   s   &r1   try_nextAsyncCommandCursor.try_next  s       ^^T^::::s   )r@   rA   r;   rK   r=   r<   rJ   rB   rM   r?   rH   r:   rG       NNNro   rX   )__name__
__module____qualname____firstlineno____doc__r   r   rS   rZ   r'   re   propertyrj   rt   r   rL   r   r   r   r   r   r   r   r   r   __static_attributes__r/   r4   r1   r    r    .   sw    AN(T.# * **`!*&X D!!; ;r4   r    c                  R   a  ] tR tRt]tR	R V 3R llltR
R R lltR R ltRt	V ;t
# )AsyncRawBatchCommandCursori.  c               8    V ^8  d   QhRRRRRRRRR	R
RRRRRR/# r"   r/   )r0   s   "r1   r2   'AsyncRawBatchCommandCursor.__annotate__1  sZ     
 
2
 '
 $	

 
 )
 .
 
 

r4   c           	     d   < VP                  R4      '       d   Q h\        SV `	  VVVVVVV4       R# )a6  Create a new cursor / iterator over raw batches of BSON data.

Should not be called directly by application developers -
see :meth:`~pymongo.asynchronous.collection.AsyncCollection.aggregate_raw_batches`
instead.

.. seealso:: The MongoDB documentation on `cursors <https://dochub.mongodb.org/core/cursors>`_.
r7   N)r>   superrS   )	rR   r$   r%   r&   r'   r)   r+   r,   	__class__s	   &&&&&&&&r1   rS   #AsyncRawBatchCommandCursor.__init__1  s<    $ ??<0000	
r4   c               0    V ^8  d   QhRRRRRRRRR	R
RR/# )r#   rw   rx   ry   r*   rz   zCodecOptions[dict[str, Any]]r{   rh   r|   rb   r-   zlist[Mapping[str, Any]]r/   )r0   s   "r1   r2   r   N  sF      ) ! 4	
 1  
!r4   c                	^    VP                  W$R 7      pV'       g   \        V^ ,          4       V# ))r{   )raw_responser   )rR   rw   ry   rz   r{   r|   r   s   &&&&&& r1   r   +AsyncRawBatchCommandCursor._unpack_responseN  s.      ,,Y,P 3<?Cr4   c                    V ^8  d   QhRRRR/# )r#   indexr(   r-   r   r/   )r0   s   "r1   r2   r   ]  s     X X X Xr4   c                	    \        R 4      h)z5Cannot call __getitem__ on AsyncRawBatchCommandCursor)r   )rR   r   s   &&r1   __getitem__&AsyncRawBatchCommandCursor.__getitem__]  s    VWWr4   r/   r   ro   )r   r   r   r   r   r   rS   r   r   r   __classcell__)r   s   @r1   r   r   .  s#    %N
 
:X Xr4   r   N).r   
__future__r   collectionsr   typingr   r   r   r   r   r	   r
   r   bsonr   r    pymongo.asynchronous.cursor_baser   r   pymongo.cursor_sharedr   pymongo.errorsr   r   r   pymongo.messager   r   r   r   pymongo.responser   pymongo.typingsr   r   r   #pymongo.asynchronous.client_sessionr   pymongo.asynchronous.collectionr   pymongo.asynchronous.poolr   _IS_SYNCr    r   r/   r4   r1   <module>r      sz    ; " 	 	 	 F Q 7 P P H H + A AF?9};)-8 };@0X!3M!B 0Xr4   