
    nh%                       U d Z ddlmZ ddlZddlZddlZddlZddlZddl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mZmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$ ddl%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z- dd	l.m/Z/ dd
l0m1Z1m2Z2m3Z3m4Z4 ddl5m6Z6m7Z7m8Z8m9Z9m:Z: ddl;m<Z< ddl=m>Z> ddl?m@Z@mAZAmBZB ddlCmDZD ddlEmFZF ddlGmHZH ddlImJZJ ddlKmLZL ddlMmNZNmOZO ddlPmQZQ ddlRmSZS erddlTmUZU ddlVmWZWmXZX 	 ddlYmZZZ dZ[g dZ]dZ^dZ_dZ`d Zad!Zbd"Zcd#Zdd$Zed%Zfd&Zgd'Zhd(Zid)Zjd*Zkd+Zld,Zmd-Znd.Zod/Zpd0Zqd1Zr ej                  d2      j                  Zu ej                  d3      j                  Zw ej                  d3      j                  Zx ej                  d4      j                  Zy ej                  d5      j                  Zz ej                  d6      j                  Z{dd7Z|dd8Z}	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd9Z~dd:Z	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd;Z	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd<Zdd=Z	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd>Z	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd?Z	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd@Z	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddAZ	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddBZ	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddCZ	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddDZ	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddEZ	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddFZ	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddGZ	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddHZ	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddIZ	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddJZi  ee^      e ee_      e ee`      e eea      e eeb      e eec      dK  eed      e eee      e eef      e eeg      dL  eeh      e eei      e eej      e eek      e eel      e eem      e~ een      e eeo      e eep      e eeq      dM  eer      dN iZdOedP<   e[r	 d	 	 	 	 	 	 	 	 	 	 	 	 	 ddQZn	 d	 	 	 	 	 	 	 	 	 	 	 	 	 ddRZ e!dSeeef   T      Z	 d	 	 	 	 	 	 	 	 	 	 	 	 	 ddUZ	 	 d	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddVZddWZe[reZj0                  Z ej                  d2      j2                  Z ej                  d3      j2                  Z ej                  d4      j2                  Z ej                  d5      j2                  Z ej                  d6      j2                  Z edX  edY      D              ZddZZdd[Zdd\Zdd]Zdd^Zdd_Zdd`ZddaZ	 	 	 	 	 	 	 	 	 	 ddbZddcZdddZddeZddfZddgZddhZddiZddjZddkZddlZddmZddnZddoZddpZddqZddrZi eeeeej                  ee8eeeeeeeeeeeee ed      ee	j                  ee,eeDee/ee<eeFeeHeeJeeLeeNeeOeeQee>eej4                  eiZi ZeD ]  Z eeds      see   eeŐj                  <   !  edt eD              Z	 	 d	 	 	 	 	 	 	 	 	 	 	 	 	 dduZddvZ	 d	 	 	 	 	 	 	 	 	 ddwZe[reZj                  Z edx      Zde1f	 	 	 	 	 	 	 ddyZe$dddz       Ze$dd{       Z	 d	 	 	 	 	 dd|Zdd}Ze[reZj                  Ze$ddd~       Ze$	 	 	 	 	 	 dd       Z	 d	 	 	 	 	 ddZ	 	 	 	 	 	 	 	 ddZddZe[reZj                  ZddZ	 	 	 	 	 	 	 	 ddZe$ddd       Ze$dd       Z	 d	 	 	 	 	 ddZe$	 d	 	 	 	 	 dd       Ze$	 	 	 	 	 	 dd       Z	 d	 	 	 	 	 ddZddZ G d de      ZddZddZ eed      r ej                  e۬       yy# e\$ r dZ[Y Mw xY w)av  BSON (Binary JSON) encoding and decoding.

The mapping from Python types to BSON types is as follows:

=======================================  =============  ===================
Python Type                              BSON Type      Supported Direction
=======================================  =============  ===================
None                                     null           both
bool                                     boolean        both
int [#int]_                              int32 / int64  py -> bson
:class:`bson.int64.Int64`                int64          both
float                                    number (real)  both
str                                      string         both
list                                     array          both
dict                                     object         both
:class:`~bson.son.SON`                   object         both
:py:class:`~collections.abc.Mapping`     object         py -> bson
:class:`~bson.raw_bson.RawBSONDocument`  object         both [#raw]_
datetime.datetime [#dt]_ [#dt2]_         UTC datetime   both
:class:`~bson.datetime_ms.DatetimeMS`    UTC datetime   both [#dt3]_
:class:`~bson.regex.Regex`               regex          both
compiled re [#re]_                       regex          py -> bson
:class:`~bson.binary.Binary`             binary         both
:py:class:`uuid.UUID` [#uuid]_           binary         both
:class:`~bson.objectid.ObjectId`         oid            both
:class:`~bson.dbref.DBRef`               dbref          both
:class:`~bson.dbref.DBRef`               dbpointer      bson -> py
None                                     undefined      bson -> py
:class:`~bson.code.Code`                 code           both
str                                      symbol         bson -> py
bytes [#bytes]_                          binary         both
:class:`~bson.timestamp.Timestamp`       timestamp      both
:class:`~bson.decimal128.Decimal128`     decimal128     both
:class:`~bson.min_key.MinKey`            min key        both
:class:`~bson.max_key.MaxKey`            max key        both
=======================================  =============  ===================

.. [#int] A Python int will be saved as a BSON int32 or BSON int64 depending
   on its size. A BSON int32 will always decode to a Python int. A BSON
   int64 will always decode to a :class:`~bson.int64.Int64`.
.. [#raw] Decoding a bson object to :class:`~bson.raw_bson.RawBSONDocument` can be
   optionally configured via :attr:`~bson.codec_options.CodecOptions.document_class`.
.. [#dt] datetime.datetime instances are encoded with millisecond precision so
   the microsecond field is truncated.
.. [#dt2] all datetime.datetime instances are encoded as UTC. By default, they
   are decoded as *naive* but timezone aware datetimes are also supported.
   See :doc:`/examples/datetimes` for examples.
.. [#dt3] To enable decoding a bson UTC datetime to a :class:`~bson.datetime_ms.DatetimeMS`
   instance see :ref:`handling-out-of-range-datetimes`.
.. [#uuid] For :py:class:`uuid.UUID` encoding and decoding behavior see :doc:`/examples/uuid`.
.. [#re] :class:`~bson.regex.Regex` instances and regular expression
   objects from ``re.compile()`` are both saved as BSON regular expressions.
   BSON regular expressions are decoded as :class:`~bson.regex.Regex`
   instances.
.. [#bytes] The bytes type is encoded as BSON binary with
   subtype 0. It will be decoded back to bytes.
    )annotationsN)utf_8_decode)utf_8_encode)abc)IOTYPE_CHECKINGAnyBinaryIOCallable	GeneratorIteratorMappingMutableMappingNoReturnOptionalSequenceTupleTypeTypeVarUnioncastoverload)ALL_UUID_SUBTYPESCSHARP_LEGACYJAVA_LEGACYOLD_UUID_SUBTYPESTANDARDUUID_SUBTYPEBinaryUuidRepresentation)Code)DEFAULT_CODEC_OPTIONSCodecOptionsDatetimeConversion_raw_document_class)EPOCH_AWAREEPOCH_NAIVE
DatetimeMS_datetime_to_millis_millis_to_datetime)DBRef)
Decimal128)InvalidBSONInvalidDocumentInvalidStringData)Int64MaxKeyMinKeyObjectId)Regex)RE_TYPESON)	Timestamp)utcRawBSONDocument)_DocumentType_ReadableBuffer)_cbsonTF)<r   r   r   r   r   r   r   r    r!   r"   r#   r+   r,   r-   r.   r/   r0   r2   r4   r6   r7   r8   r9   r:   r;   r&   r'   BSONNUMBSONSTRBSONOBJBSONARRBSONBINBSONUNDBSONOIDBSONBOOBSONDATBSONNULBSONRGXBSONREFBSONCODBSONSYMBSONCWSBSONINTBSONTIMBSONLONBSONDECBSONMINBSONMAXget_data_and_viewgen_list_nameencodedecode
decode_alldecode_iterdecode_file_iteris_validBSONhas_cr$   r(                              	   
                                 z<dz<iz<iBz<qz<IIc                    t        | t        t        f      r| t        |       fS t        |       }|j	                         |fS N)
isinstancebytes	bytearray
memoryviewtobytes)dataviews     s/var/www/html/SchoolMeal/SchoolMeal/pds_admin_SchoolMeal/Backend/venv/lib/python3.12/site-packages/bson/__init__.pyrV   rV      s<    $	*+Z%%%dD<<>4    c                f    t        dj                  t        |       j                         |            )zUnknown type helper.z\Detected unknown BSON type {!r} for fieldname '{}'. Are you using the latest driver version?)r-   formatchrrX   )element_typeelement_names     r~   _raise_unknown_typer      s/    
	//5vc,6G6N6N6PR^/_ r   c                *    t        | |      d   |dz   fS )z"Decode a BSON int32 to python int.r      )_UNPACK_INT_FROMr|   _viewpositiondummy0dummy1dummy2s         r~   _get_intr     s     D(+A.1<<r   c                j    | j                  d|      }t        ||| |j                  d      d   |dz   fS )z'Decode a BSON 'C' string to python str.    Tr      )index_utf_8_decodeunicode_decode_error_handler)r|   r}   r   optsends        r~   _get_c_stringr     sA    
**Wh
'Chs+T-N-NPTUVWXZ]`aZaaar   c                *    t        | |      d   |dz   fS )z%Decode a BSON double to python float.r      )_UNPACK_FLOAT_FROMr   s         r~   
_get_floatr     s     dH-a0(Q,>>r   c                    t        | |      d   }|dz  }|dk  s||z
  |k  rt        d      ||z   dz
  }| |   dk7  rt        d      t        ||| |j                  d      d   |dz   fS )z#Decode a BSON string to python str.r   r   r   zinvalid string lengthzinvalid end of stringT)r   r-   r   r   )r|   r}   r   obj_endr   dummylengthr   s           r~   _get_stringr     s     dH-a0FMHzWx'&0122
V
a
CCyA~122hs+T-N-NPTUVWXZ]`aZaaar   c                
   	 t        | |      d   }||z   dz
  }||k\  rt        d      | |   dk7  rt        d      |dk(  r||k7  rt        d      ||fS # t        j                  $ r}t        t	        |            dd}~ww xY w)z+Validate and return a BSON document's size.r   Nr   zinvalid object lengthbad eoo)r   structerrorr-   str)r|   r   r   obj_sizeexcr   s         r~   _get_object_sizer   (  s    .#D(3A6 X

!C
g~122CyA~)$$1}W,122S= << .#c(#-.s   A B(A==Bc                   t        | ||      \  }}t        |j                        r|j                  | ||dz    |      ||z   fS t        | ||dz   ||      }||z  }t	        |j                  d      t              rmd|v rit	        |j                  d      t        t        d      f      r?t        |j                  d      |j                  dd      |j                  dd      |      |fS ||fS )zEDecode a BSON subdocument to opts.document_class or bson.dbref.DBRef.r   r   z$refz$idz$dbN)
r   r%   document_class_elements_to_dictrw   getr   typer+   pop)	r|   r}   r   r   r   r   r   r   objs	            r~   _get_objectr   9  s     %T8W=MHc4../##DC!G$<dCXPXEXYY
D$1c4
@CH 	3776?C(SLswwu~T$Z'89cggfoswwud';SWWUD=QSVWYabb=r   c                   t        | |      d   }||z   dz
  }| |   dk7  rt        d      |dz  }|dz  }g }|j                  }	| j                  }
t        }|j
                  j                  }||k  rY| |   } |
d|      dz   }	  ||   | |||||      \  }}|r$|j                  t                    }| ||      } |	       ||k  rY||dz   k7  rt        d      ||dz   fS # t        $ r t        ||       Y ew xY w)z#Decode a BSON array to python list.r   r   r   r   r   zbad array length)r   r-   appendr   _ELEMENT_GETTERtype_registry_decoder_mapKeyErrorr   r   r   )r|   r}   r   r   r   r   sizer   resultr   r   getterdecoder_mapr   valuecustom_decoders                   r~   
_get_arrayr   N  s=    D(+A.D
T/A
CCyA~)$$MH1HCF ]]FJJEF$$11K
S.H~(+a/	<2f\2dHgt\OE8 (__T%[9N)&u-u! S.$ 37,--8a<  	<l;	<s   C# #C;:C;c                   t        | |      \  }}|dz  }|dk(  r)t        | |      d   }|dz  }||dz
  k7  rt        d      |}||z   }	|dk  s|	|kD  rt        d      |t        v ri|j                  }
t        | ||	 |      }|
t        j                  k(  s$|t        k(  r	|
t        k7  s|t        k(  r|
t        k(  r||	fS |j                  |
      |	fS |dk(  r	| ||	 }||	fS t        | ||	 |      }||	fS )z:Decode a BSON binary to bson.binary.Binary or python UUID.      r   r   z,invalid binary (st 2) - lengths don't match!zbad binary object length)_UNPACK_LENGTH_SUBTYPE_FROMr   r-   r   uuid_representationr   r    UNSPECIFIEDr   r   r   as_uuid)r|   r   r   r   r   r   r   subtypelength2r   uuid_repbinary_valuer   s                r~   _get_binaryr   x  s6    2$AOFGMH!|"4215Afqj LMM
V
CzS7]455 ##++d8C0':+777<'H,@++H0D$$##H-s22 !|Xc" #: tHS)73#:r   c                ,    |dz   }t        | ||       |fS )z1Decode a BSON ObjectId to bson.objectid.ObjectId.   r5   r|   r   r   r   r   r   r   s          r~   _get_oidr     s$     R-CD#&',,r   c                V    |dz   }| || }|dk(  rd|fS |dk(  rd|fS t        d|z        )z.Decode a BSON true/false to python True/False.r   r   Fr`   Tzinvalid boolean value: %r)r-   )r|   r   r   r   r   r   r   boolean_bytes           r~   _get_booleanr     sN     Q,C%Lwcz		 Sy
1L@
AAr   c                >    t        t        | |      d   |      |dz   fS )z3Decode a BSON datetime to python datetime.datetime.r   r   )r*   _UNPACK_LONG_FROM)r|   r   r   r   r   r   s         r~   	_get_dater     s(     0x@CTJHWXLXXr   c                B    t        | |||||      \  }}t        |      |fS )z%Decode a BSON code to bson.code.Code.)r   r!   )r|   r}   r   r   r   r   codes          r~   	_get_coder     s+     !tXwlSND(:xr   c                    |t        | |      d   z   }t        | ||dz   |||      \  }}t        | |||||      \  }}||k7  rt        d      t	        ||      |fS )z-Decode a BSON code_w_scope to bson.code.Code.r   r   z+scope outside of javascript code boundaries)r   r   r   r-   r!   )	r|   r}   r   _obj_endr   r   code_endr   scopes	            r~   _get_code_w_scoper     su     *4:1==H tX\8T<XND(!$h$UOE88GHHeh&&r   c                f    t        | |||      \  }}t        | |||      \  }}t        ||      }||fS )zCDecode a BSON regex to bson.regex.Regex or a python pattern object.)r   r7   )	r|   r}   r   r   r   r   pattern
bson_flagsbson_res	            r~   
_get_regexr     sE     &dD(DAGX(tXtDJGZ(GHr   c                j    t        | |||||      \  }}t        | |||||      \  }}t        ||      |fS )z7Decode (deprecated) BSON DBPointer to bson.dbref.DBRef.)r   r   r+   )r|   r}   r   r   r   r   
collectionoids           r~   _get_refr     sG     'tT8WdLYJT47D,OMCS!8++r   c                B    t        | |      \  }}t        ||      |dz   fS )z4Decode a BSON timestamp to bson.timestamp.Timestamp.r   )_UNPACK_TIMESTAMP_FROMr:   )r|   r   r   r   r   r   inc	timestamps           r~   _get_timestampr     s*     ,D(;NCY$hl22r   c                <    t        t        | |      d         |dz   fS )z(Decode a BSON int64 to bson.int64.Int64.r   r   )r0   r   r   s         r~   
_get_int64r     s%     "421561DDr   c                @    |dz   }t        j                  | ||       |fS )z7Decode a BSON decimal128 to bson.decimal128.Decimal128.   )r,   from_bidr   s          r~   _get_decimal128r     s*     R-CtHS12C77r   c                
    d |fS rv    uvwxyzs         r~   <lambda>r     
    D!9 r   c                
    d |fS rv   r   r   s         r~   r   r     r   r   c                    t               |fS rv   r3   r   s         r~   r   r         FHa= r   c                    t               |fS rv   r1   r   s         r~   r   r     r   r   z)dict[int, Callable[..., Tuple[Any, int]]]r   c           
     H    t        dt        j                  | ||||            S )NTuple[str, Any, int])r   r@   _element_to_dict)r|   r}   r   r   r   	raw_arrays         r~   r  r    s*     "##D(GT9M
 	
r   c                   | |   }|dz  }t        | |||      \  }}|r9|t        t              k(  r't        | |t	        |             \  }}	||||	dz    |	dz   fS 	 t        |   | |||||      \  }
}|j                  j                  r8|j                  j                  j                  t        
            }| ||
      }
|
|fS # t        $ r t        ||       Y jw xY w)z Decode a single key, value pair.r   )r   ordrD   r   lenr   r   r   r   r   r   r   )r|   r}   r   r   r   r  r   r   _r   r   r   s               r~   r  r  '  s     H~A!.tT8T!JhW5%dHc$i@FAshq!937BB	<-l;dHgt\OE8 **!//<<@@eMN)&u-UH,,  	<l;	<s   C CC_T)boundc                ^    t        |       \  } }t        t        t        | ||||||            S )Nr  )rV   r   r  r   )r|   r   r   r   r   r  r}   s          r~   _raw_to_dictr  H  s7     #4(JD$
dD(GT6U^_ r   c                    ||j                         }|dz
  }||k  r t        | |||||      \  }}	}|	||<   ||k  r ||k7  rt        d      |S )z#Decode a BSON document into result.r   r  bad object or element length)r   r  r-   )
r|   r}   r   r   r   r   r  r   keyr   s
             r~   r   r   V  st     ~$$&
A+C
S./$'49 
UH s	 S.
 7899Mr   c           
     v   t        |       \  } }	 t        |j                        r|j                  | |      S t        | dt	        |             \  }}t        dt        | |d||            S # t        $ r  t        $ r= t        j                         \  }}}t        t        |            j                  |      dw xY w)z'Decode a BSON string to document_class.r   r>   r   N)rV   r%   r   r   r  r   r   r-   	Exceptionsysexc_infor   with_traceback)r|   r   r}   r  r   	exc_valueexc_tbs          r~   _bson_to_dictr  m  s    "4(JD$
Kt223&&tT22!$3t953O%6tT1c4%PQQ  K"||~9f#i.)88@dJKs   &A) 1A) )AB8c              #  V   K   | ]!  }t        |      d z   j                  d       # yw) utf8N)r   rX   ).0is     r~   	<genexpr>r    s#     JSVf_,,V4Js   ')  c               #     K   t         E d{    t        j                  d      } 	 t        t	        |             dz   j                  d       )7 Cw)zGenerate "keys" for encoded lists in the sequence
    b"0 ", b"1 ", b"2 ", ...

    The first 1000 keys are returned from a pre-built cache. All
    subsequent keys are generated on the fly.
    Nr  r  r  )_LIST_NAMES	itertoolscountr   nextrX   )counters    r~   rW   rW     sK      ood#G
4=!F*226::  s   
AAAAc                    t        | t              r"d| v rt        d      	 t        | dd       | dz   S d| v rt        d      t        |       d   dz   S # t        $ r t        d| z        dw xY w)z8Make a 'C' string, checking for embedded NUL characters.r   z;BSON keys / regex patterns must not contain a NUL characterNT,strings in documents must be valid UTF-8: %rr  r   )rw   rx   r.   r   UnicodeErrorr/   _utf_8_encodestrings    r~   _make_c_string_checkr+    s    &% f!"_``	&$-G## V!"_``V$Q''11  	#>G	s   A A,c                    t        | t              r	 t        | dd       | dz   S t        |       d   dz   S # t        $ r t	        d| z        dw xY w)zMake a 'C' string.NTr   r&  r   )rw   rx   r   r'  r/   r(  r)  s    r~   _make_c_stringr-    sh    &% 	&$-G## V$Q''11  	#>G	s	   5 Ac                B    d| v rt        d      t        |       d   dz   S )z*Make a 'C' string suitable for a BSON key.r  z*BSON keys must not contain a NUL characterr   r   )r.   r(  r)  s    r~   
_make_namer/    s+    JKK #g--r   c                $    d| z   t        |      z   S )zEncode a float.r`   )_PACK_FLOATnamer   r   r   s       r~   _encode_floatr4    s    T>K...r   c                B    d| z   t        t        |            z   dz   |z   S )zEncode a python bytes.rd   r   )	_PACK_INTr  r2  s       r~   _encode_bytesr7    s&     T>Ic%j11G;eCCr   c                &   t        |      r d| z   t        t        |j                        z   S dj	                  |j                         D cg c]  \  }}t        ||||       c}}      }d| z   t        t        |      dz         z   |z   dz   S c c}}w )zEncode a mapping type.rb   r   r   r   )	r%   r   rx   rawjoinitems_element_to_bsonr6  r  )r3  r   
check_keysr   r  valr|   s          r~   _encode_mappingr?    s    5!~UEII 66688RWR]R]R_`hc3%c3
DA`aDT>Ic$i!m44t;gEE as   
B
c                   t        d| z   dz         }t        |      dz
  }|t        d|j                  ||      z  }|t        d|j                  ||      z  }|j
                  |t        d|j
                  ||      z  }|j                  j                         D ]  \  }}|t        ||||      z  } |dz  }t        t        |      |z
        |||dz    t        |      S )zEncode bson.dbref.DBRef.rb   s       r   s   $ref s   $id s   $db r   )ry   r  _name_value_to_bsonr   iddatabase_DBRef__kwargsr;  r<  r6  rx   )r3  r   r=  r   bufbeginr  r>  s           r~   _encode_dbrefrG    s    
GdN%88
9CHqLE{E,<,<j$OOCz588ZFFC~~!":u~~z4PP((..0 <SS*d;;< 7NC&s3x%'78C	:r   c                    t               }dj                  |D cg c]  }t        t        |      |||       c}      }d| z   t	        t        |      dz         z   |z   dz   S c c}w )zEncode a list/tuple.r   rc   r   r   )rW   r:  rA  r#  r6  r  )r3  r   r=  r   lnameitemr|   s          r~   _encode_listrK    sb     OE88Z_`RV(edJM`aDT>Ic$i!m44t;gEE as   A"c                d    t        |      d   }d| z   t        t        |      dz         z   |z   dz   S )zEncode a python str.r   ra   r   r   )r(  r6  r  )r3  r   r   r   bvalues        r~   _encode_textrN    s7    5!!$FT>Ic&kAo66?'IIr   c                    |j                   }|dk(  rt        t        |            |z   }d| z   t        t        |      |      z   |z   S )zEncode bson.binary.Binary.r   rd   )r   r6  r  _PACK_LENGTH_SUBTYPE)r3  r   r   r   r   s        r~   _encode_binaryrQ    sE    mmG!|#e*%-T>0UWEEMMr   c                d    |j                   }t        j                  ||      }t        | |||      S )zEncode uuid.UUID.)r   )r   r   	from_uuidrQ  )r3  r   r   r   r   binvals         r~   _encode_uuidrU    s2    22e9LMF$t44r   c                &    d| z   |j                   z   S )zEncode bson.objectid.ObjectId.rf   )binary)r3  r   r   r   s       r~   _encode_objectidrX     s    T>ELL((r   c                "    d| z   |xr dxs dz   S )z%Encode a python boolean (True/False).rg   r`   r   r   r2  s       r~   _encode_boolrZ    s    T>U.w9'::r   c                :    t        |      }d| z   t        |      z   S zEncode datetime.datetime.rh   )r)   
_PACK_LONGr3  r   r   r   milliss        r~   _encode_datetimer`  
  s      'FT>Jv...r   c                :    t        |      }d| z   t        |      z   S r\  )intr]  r^  s        r~   _encode_datetime_msrc    s    ZFT>Jv...r   c                    d| z   S )zEncode python None.ri   r   r3  r   r   r   s       r~   _encode_nonerf        T>r   c                ,   |j                   }|t        j                  k(  rd| z   t        |j                        z   dz   S |dk(  rd| z   t        |j                        z   dz   S d}|t        j
                  z  r|dz  }|t        j                  z  r|dz  }|t        j                  z  r|dz  }|t        j                  z  r|d	z  }|t        j                  z  r|d
z  }|t        j                  z  r|dz  }|dz  }d| z   t        |j                        z   |z   S )z*Encode a python regex or bson.regex.Regex.rj   s   u r   r   r      i   l   m   s   u   x)
flagsreUNICODEr+  r   
IGNORECASELOCALE	MULTILINEDOTALLVERBOSE)r3  r   r   r   ro  sflagss         r~   _encode_regexrx    s   KKE

~ 4U]] CChNN	!~ 4U]] CCgMM2== dNF299dNF2<<dNF299dNF2::dNF2::dNF'~ 4U]] CCfLLr   c                   t        |      }t        |      }|j                  d| z   t        |      z   |z   S t	        |j                  d|d      }t        d|z   t        |      z         }d| z   |z   t        |      z   |z   |z   S )zEncode bson.code.Code.rl   Fr   rn   )r-  r  r   r6  _dict_to_bson)r3  r   r   r   cstringcstrlenr   full_lengths           r~   _encode_coder~  5  s    U#G'lG{{~	' 22W<<%++udE:EAK#e*45KT>K')G*<<wFNNr   c                    d|cxk  rdk  rn nd| z   t        |      z   S 	 d| z   t        |      z   S # t        j                  $ r t	        d      dw xY w)zEncode a python int.i   iro   rq   &BSON can only handle up to 8-byte intsN)r6  r]  r   r   OverflowErrorr2  s       r~   _encode_intr  @  s`    e)z)~	% 000	TT>Ju$555|| 	T HItS	Ts	   2  Ac                N    d| z   t        |j                  |j                        z   S )z Encode bson.timestamp.Timestamp.rp   )_PACK_TIMESTAMPr   timer2  s       r~   _encode_timestampr  K  s     T>OEIIuzzBBBr   c                l    	 d| z   t        |      z   S # t        j                  $ r t        d      dw xY w)zEncode a bson.int64.Int64.rq   r  N)r]  r   r   r  r2  s       r~   _encode_longr  P  s?    P~
5 111<< PDE4OPs     3c                &    d| z   |j                   z   S )z"Encode bson.decimal128.Decimal128.rr   )bidr2  s       r~   _encode_decimal128r  X  s    T>EII%%r   c                    d| z   S )zEncode bson.min_key.MinKey.rs   r   re  s       r~   _encode_minkeyr  ]  rg  r   c                    d| z   S )zEncode bson.max_key.MaxKey.rt   r   re  s       r~   _encode_maxkeyr  b  rg  r   _type_markerc              #      K   | ]  }|  y wrv   r   )r  ts     r~   r  r    s     -a-s   c                   d}	 t        t        |         | |||      S # t        $ r Y n!t        $ r t	        |t
              s d}Y nw xY wt        |dd      }t	        |t
              r.|t        v r&t        |   }|t         t        |      <    || |||      S |s\|j                  j                  rF|j                  j                  j                  t        |            }	|	t        |  |	|      ||d      S t        D ]9  }
|rt	        ||
      st         |
   }|t         t        |      <    || |||      c S  |j                  j                  }|s|t        |  ||      ||d      S |rt        d      t        d|d	t        |            )
z!Encode a single name, value pair.FTr  N)in_custom_call)in_fallback_callr  zcannot encode object: z, of type: )	_ENCODERSr   r   r  rw   rb  getattr_MARKERSr   _encoder_mapr   rA  _BUILT_IN_TYPES_fallback_encoderr.   )r3  r   r=  r   r  r  was_integer_overflowmarkerfunccustom_encoderbasefallback_encoders               r~   rA  rA    s    !	$e%dE:tDD  $%%  $$ UND1F&#6X#5!%	$u+D%T22 d00==++88<<T%[I%&nU+Zd    7#
5$(?T?D%)Id5k"eZ667 ));; 0 <""5):td
 	
 DEE
25);tE{oV
WWs    	AAAc                    t        | t              st        d|       |r3| j                  d      rt        d| d      d| v rt        d| d      t	        |       }t        ||||      S )z Encode a single key, value pair.z.documents must have only string keys, key was $zkey z must not start with '$'.z must not contain '.')rw   r   r.   
startswithr/  rA  )r  r   r=  r   r3  s        r~   r<  r<    sy    c3 NsgVWW>>#!D/G"HII#:!D/D"EFFc?DtUJ==r   c           	        t        |       rt        t        | j                        S 	 g }|r$d| v r |j	                  t        d| d   ||             | j                         D ]+  \  }}|r|dk7  s	 |j	                  t        ||||             - 	 dj                  |      }t        t        |      dz         |z   d	z   S # t        $ r}t        d|  d|       |d}~ww xY w# t        $ r t        d|       dw xY w)
zEncode a document to BSON._ids   _id zInvalid document z | Nz)encoder expected a mapping type but got: r   r   r   )r%   r   rx   r9  r   rA  r;  r<  r.   AttributeError	TypeErrorr:  r6  r  )	docr=  r   	top_levelelementsr  r   errencodeds	            r~   rz  rz    s    3E377##W#OO/
CJ
TXYZ))+ 	VJCuVOO$4S%T$RS	V hhx GS\A%&07:: ' V),=cU#cU*KLRUUV WCC7KLRVVWs0   AC .B<C <	CCCC C8z1codec_options must be an instance of CodecOptionsc                H    t        |t              st        t        | ||      S )a  Encode a document to BSON.

    A document can be any mapping type (like :class:`dict`).

    Raises :class:`TypeError` if `document` is not a mapping type,
    or contains keys that are not instances of :class:`str`. Raises
    :class:`~bson.errors.InvalidDocument` if `document` cannot be
    converted to :class:`BSON`.

    :param document: mapping type representing a document
    :param check_keys: check if keys start with '$' or
        contain '.', raising :class:`~bson.errors.InvalidDocument` in
        either case
    :param codec_options: An instance of
        :class:`~bson.codec_options.CodecOptions`.

    .. versionadded:: 3.9
    )rw   r#   _CODEC_OPTIONS_TYPE_ERRORrz  )documentr=  codec_optionss      r~   rX   rX     s#    . m\2'':}==r   c                     y rv   r   r|   r  s     r~   rY   rY          r   c                     y rv   r   r  s     r~   rY   rY   %  r  r   c                n    |xs t         }t        |t              st        t	        dt        | |            S )a  Decode BSON to a document.

    By default, returns a BSON document represented as a Python
    :class:`dict`. To use a different :class:`MutableMapping` class,
    configure a :class:`~bson.codec_options.CodecOptions`::

        >>> import collections  # From Python standard library.
        >>> import bson
        >>> from bson.codec_options import CodecOptions
        >>> data = bson.encode({'a': 1})
        >>> decoded_doc = bson.decode(data)
        <type 'dict'>
        >>> options = CodecOptions(document_class=collections.OrderedDict)
        >>> decoded_doc = bson.decode(data, codec_options=options)
        >>> type(decoded_doc)
        <class 'collections.OrderedDict'>

    :param data: the BSON to decode. Any bytes-like object that implements
        the buffer protocol.
    :param codec_options: An instance of
        :class:`~bson.codec_options.CodecOptions`.

    .. versionadded:: 3.9
    $Union[dict[str, Any], _DocumentType])r"   rw   r#   r  r   r  )r|   r  r   s      r~   rY   rY   *  s4    6 ,D/DDdL)''6dD8QRRr   c           	     J   t        |       \  } }t        |       }g }d}|dz
  }t        |j                        }	 ||k  rt	        | |      d   }||z
  |k  rt        d      ||z   dz
  }	| |	   dk7  rt        d      |r(|j                  |j                  | ||	dz    |             n!|j                  t        | ||dz   |	|             ||z  }||k  r|S # t
        $ r  t        $ r= t        j                         \  }
}}t        t        |            j                  |      dw xY w)z)Decode a BSON data to multiple documents.r   r   zinvalid object sizer   r   N)rV   r  r%   r   r   r-   r   r   r  r  r  r   r  )r|   r   r}   data_lendocsr   r   use_rawr   r   r  r  r  s                r~   _decode_allr  L  sC   "4(JD$4yH "DH
Q,C!$"5"56GKn'h7:H("X-!"788)A-GG}!!),,D//X!0LdST-dD(Q,QUVW H n   K"||~9f#i.)88@dJKs   BC C AD"c                     y rv   r   r  s     r~   rZ   rZ   n  r  r   c                     y rv   r   r  s     r~   rZ   rZ   s       r   c                j    |t        | t              S t        |t              st        t        | |      S )a+  Decode BSON data to multiple documents.

    `data` must be a bytes-like object implementing the buffer protocol that
    provides concatenated, valid, BSON-encoded documents.

    :param data: BSON data
    :param codec_options: An instance of
        :class:`~bson.codec_options.CodecOptions`.

    .. versionchanged:: 3.9
       Supports bytes-like objects that implement the buffer protocol.

    .. versionchanged:: 3.0
       Removed `compile_re` option: PyMongo now always represents BSON regular
       expressions as :class:`~bson.regex.Regex` objects. Use
       :meth:`~bson.regex.Regex.try_compile` to attempt to convert from a
       BSON regular expression to a Python regular expression object.

       Replaced `as_class`, `tz_aware`, and `uuid_subtype` options with
       `codec_options`.
    )r  r"   rw   r#   r  r  s     r~   rZ   rZ   z  s5    0 4!677m\2''t]++r   c                
   t        |j                        ri }n|j                         }| j                         D ]G  \  }}||v r9||   dk(  rt        | j                  |      |   ||<   /t        |||   |      ||<   C|||<   I |S )Nr   )r%   r   r;  r  r9  _decode_selective)rawdocfieldsr  r  r  r   s         r~   r  r    s     =778   **,lln 	
U&=c{a(]CCHC,6#;C CH	 Jr   c                T   d}t        |       }t        ||t        |            \  }}|dz  }g }|j                  }||dz
  k  rG||   dk7  r|dz  }||   dk7  r|dz  }t        |||      \  }} |||||z           ||z  }||dz
  k  rG||k7  rt	        d      dj                  |      S )Nr   r   r   r  r   )rz   r   r  r   r-   r:  )r|   r   r}   r  r   buffersr   r   s           r~   _array_of_documents_to_bufferr    s    HdDdHc$i8FAsMH "G^^F
S1W
8n!MH 8n!A&tXs;!tHx(234H S1W
 389988Gr   c                    | j                  d      }|sydD ]/  }|j                  |      }|st        |      }|r|g||<   +g ||<   1 y)z=Convert raw array of documents to a stream of BSON documents.cursorN)
firstBatch	nextBatch)r   r  )r  r  r  batchr|   s        r~   &_convert_raw_document_lists_to_streamsr    sY    \\(#F* 

3,U3&F3KF3Kr   c                    |j                   j                  st        | |      S |st        | |j                  d            S ddlm} |j                  |d      }t        | |      }t        |||      gS )aW  Decode BSON data to a single document while using user-provided
    custom decoding logic.

    `data` must be a string representing a valid, BSON-encoded document.

    :param data: BSON data
    :param codec_options: An instance of
        :class:`~bson.codec_options.CodecOptions` with user-specified type
        decoders. If no decoders are found, this method is the same as
        ``decode_all``.
    :param fields: Map of document namespaces where data that needs
        to be custom decoded lives or None. For example, to custom decode a
        list of objects in 'field1.subfield1', the specified value should be
        ``{'field1': {'subfield1': 1}}``. If ``fields``  is an empty map or
        None, this method is the same as ``decode_all``.

    :return: Single-member list containing the decoded document.

    .. versionadded:: 3.8
    N)r   r   r<   )r   r   )r   r   rZ   with_optionsbson.raw_bsonr=   r  r  )r|   r  r  r=   internal_codec_options_docs         r~   _decode_all_selectiver    s    . &&33$..$ : : : NOO .<I<V<V&d =W = 56D	
 r   c                     y rv   r   r  s     r~   r[   r[     r  r   c                     y rv   r   r  s     r~   r[   r[     r  r   c              #     K   |xs t         }t        |t              st        d}t	        |       dz
  }||k  r1t        | |      d   }| |||z    }||z  }t        ||       ||k  r0yyw)a  Decode BSON data to multiple documents as a generator.

    Works similarly to the decode_all function, but yields one document at a
    time.

    `data` must be a string of concatenated, valid, BSON-encoded
    documents.

    :param data: BSON data
    :param codec_options: An instance of
        :class:`~bson.codec_options.CodecOptions`.

    .. versionchanged:: 3.0
       Replaced `as_class`, `tz_aware`, and `uuid_subtype` options with
       `codec_options`.

    .. versionadded:: 2.8
    r   r   N)r"   rw   r#   r  r  r   r  )r|   r  r   r   r   r   r  s          r~   r[   r[     s~     * 11DdL)''H
d)a-C
S.#D(3A68h#67HHd++ S.s   A%A*(A*c                     y rv   r   file_objr  s     r~   r\   r\   5  r  r   c                     y rv   r   r  s     r~   r\   r\   <  r  r   c              #     K   |xs t         }	 | j                  d      }|syt        |      dk7  rt        d      t	        |d      d   dz
  }|| j                  t        d|            z   }t        ||       lw)a  Decode bson data from a file to multiple documents as a generator.

    Works similarly to the decode_all function, but reads from the file object
    in chunks and parses bson in chunks, yielding one document at a time.

    :param file_obj: A file object containing BSON data.
    :param codec_options: An instance of
        :class:`~bson.codec_options.CodecOptions`.

    .. versionchanged:: 3.0
       Replaced `as_class`, `tz_aware`, and `uuid_subtype` options with
       `codec_options`.

    .. versionadded:: 2.8
    r   zcut off in middle of objsizer   N)r"   readr  r-   r   maxr  )r  r  r   	size_datar   r  s         r~   r\   r\   C  s     & 11D
!q)	^q <==#Iq1!4q8x}}SH-=>>Hd++ s   A8A:c                    t        | t              st        dt        |              	 t	        | t
               y# t        $ r Y yw xY w)a  Check that the given string represents valid :class:`BSON` data.

    Raises :class:`TypeError` if `bson` is not an instance of
    :class:`bytes`. Returns ``True``
    if `bson` is valid :class:`BSON`, ``False`` otherwise.

    :param bson: the data to be validated
    z:BSON data must be an instance of a subclass of bytes, not TF)rw   rx   r  r   r  r"   r  )bsons    r~   r]   r]   c  sN     dE"TUYZ^U_T`abbd12 s   : 	AAc                  L    e Zd ZdZedef	 	 	 	 	 	 	 	 	 dd       Zef	 	 	 ddZy)r^   zBSON (Binary JSON) data.

    .. warning:: Using this class to encode and decode BSON adds a performance
       cost. For better performance use the module level functions
       :func:`encode` and :func:`decode` instead.
    Fc                (     | t        |||            S )a  Encode a document to a new :class:`BSON` instance.

        A document can be any mapping type (like :class:`dict`).

        Raises :class:`TypeError` if `document` is not a mapping type,
        or contains keys that are not instances of
        :class:`str'. Raises :class:`~bson.errors.InvalidDocument`
        if `document` cannot be converted to :class:`BSON`.

        :param document: mapping type representing a document
        :param check_keys: check if keys start with '$' or
            contain '.', raising :class:`~bson.errors.InvalidDocument` in
            either case
        :param codec_options: An instance of
            :class:`~bson.codec_options.CodecOptions`.

        .. versionchanged:: 3.0
           Replaced `uuid_subtype` option with `codec_options`.
        )rX   )clsr  r=  r  s       r~   rX   zBSON.encode~  s    4 6(J>??r   c                    t        | |      S )a  Decode this BSON data.

        By default, returns a BSON document represented as a Python
        :class:`dict`. To use a different :class:`MutableMapping` class,
        configure a :class:`~bson.codec_options.CodecOptions`::

            >>> import collections  # From Python standard library.
            >>> import bson
            >>> from bson.codec_options import CodecOptions
            >>> data = bson.BSON.encode({'a': 1})
            >>> decoded_doc = bson.BSON(data).decode()
            <type 'dict'>
            >>> options = CodecOptions(document_class=collections.OrderedDict)
            >>> decoded_doc = bson.BSON(data).decode(codec_options=options)
            >>> type(decoded_doc)
            <class 'collections.OrderedDict'>

        :param codec_options: An instance of
            :class:`~bson.codec_options.CodecOptions`.

        .. versionchanged:: 3.0
           Removed `compile_re` option: PyMongo now always represents BSON
           regular expressions as :class:`~bson.regex.Regex` objects. Use
           :meth:`~bson.regex.Regex.try_compile` to attempt to convert from a
           BSON regular expression to a Python regular expression object.

           Replaced `as_class`, `tz_aware`, and `uuid_subtype` options with
           `codec_options`.
        )rY   )selfr  s     r~   rY   zBSON.decode  s    @ dM**r   N)
r  z
Type[BSON]r  Mapping[str, Any]r=  boolr  CodecOptions[Any]returnr^   )r  r  r  dict[str, Any])__name__
__module____qualname____doc__classmethodr"   rX   rY   r   r   r~   r^   r^   v  ss      !+@	@@#@ @ )	@
 
@ @8 2G +. +	 +r   r^   c                     t         S )zIs the C extension installed?)_USE_Cr   r   r~   r_   r_     s    Mr   c                 ~    t         j                  j                         rt         j                  j                          yy)z!Releases the ObjectID lock child.N)r6   	_inc_locklockedreleaser   r   r~   _after_forkr    s+      """$ #r   register_at_fork)after_in_child)r|   r	   r  zTuple[Any, memoryview])r   rb  r   r   r  r   )r|   r	   r   r	   r   rb  r   r	   r   r	   r   r	   r  Tuple[int, int])
r|   r	   r}   r	   r   rb  r   r  r  Tuple[str, int])r|   r	   r   r	   r   rb  r   r	   r   r	   r   r	   r  zTuple[float, int])r|   r	   r}   r	   r   rb  r   rb  r   r  r   r	   r  r  )r|   r	   r   rb  r   rb  r  r  )r|   r	   r}   r	   r   rb  r   rb  r   r  r   r	   r  Tuple[Any, int])r|   r	   r}   r	   r   rb  r   rb  r   r  r   r   r  r  )r|   r	   r   r	   r   rb  r   rb  r   r  r   r	   r  z$Tuple[Union[Binary, uuid.UUID], int])r|   r	   r   r	   r   rb  r   r	   r   r	   r   r	   r  zTuple[ObjectId, int])r|   r	   r   r	   r   rb  r   r	   r   r	   r   r	   r  zTuple[bool, int])r|   r	   r   r	   r   rb  r   rb  r   r  r   r	   r  z0Tuple[Union[datetime.datetime, DatetimeMS], int])r|   r	   r}   r	   r   rb  r   rb  r   r  r   r   r  Tuple[Code, int])r|   r	   r}   r	   r   rb  r   rb  r   r  r   r   r  r  )r|   r	   r}   r	   r   rb  r   r	   r   r  r   r	   r  zTuple[Regex[Any], int])r|   r	   r}   r	   r   rb  r   rb  r   r  r   r   r  zTuple[DBRef, int])r|   r	   r   r	   r   rb  r   r	   r   r	   r   r	   r  zTuple[Timestamp, int])r|   r	   r   r	   r   rb  r   r	   r   r	   r   r	   r  zTuple[Int64, int])r|   r	   r   r	   r   rb  r   r	   r   r	   r   r	   r  zTuple[Decimal128, int])F)r|   r	   r}   r	   r   rb  r   rb  r   r  r  r  r  r  )r|   r	   r   rb  r   rb  r   zCodecOptions[RawBSONDocument]r   r  r  r  r  r  )NF)r|   r	   r}   r	   r   rb  r   rb  r   r  r   r	   r  r  r  r	   )r|   r	   r   CodecOptions[_DocumentType]r  r>   )r  zGenerator[bytes, None, None])r*  zUnion[str, bytes]r  rx   )r*  r   r  rx   )
r3  rx   r   floatr   r	   r   r	   r  rx   )
r3  rx   r   rx   r   r	   r   r	   r  rx   )
r3  rx   r   r	   r=  r  r   r  r  rx   )
r3  rx   r   r+   r=  r  r   r  r  rx   )
r3  rx   r   zSequence[Any]r=  r  r   r  r  rx   )
r3  rx   r   r   r   r	   r   r	   r  rx   )
r3  rx   r   r   r   r	   r   r	   r  rx   )
r3  rx   r   z	uuid.UUIDr   r	   r   r  r  rx   )
r3  rx   r   r6   r   r	   r   r	   r  rx   )
r3  rx   r   r  r   r	   r   r	   r  rx   )
r3  rx   r   zdatetime.datetimer   r	   r   r	   r  rx   )
r3  rx   r   r(   r   r	   r   r	   r  rx   )
r3  rx   r   r	   r   r	   r   r	   r  rx   )
r3  rx   r   z
Regex[Any]r   r	   r   r	   r  rx   )
r3  rx   r   r!   r   r	   r   r  r  rx   )
r3  rx   r   rb  r   r	   r   r	   r  rx   )
r3  rx   r   r	   r   r	   r   r	   r  rx   )
r3  rx   r   r,   r   r	   r   r	   r  rx   )FF)r3  rx   r   r	   r=  r  r   r  r  r  r  r  r  rx   )
r  r	   r   r	   r=  r  r   r  r  rx   )T)
r  r	   r=  r  r   r  r  r  r  rx   )r  r  r=  r  r  r  r  rx   rv   )r|   r?   r  Noner  r  )r|   r?   r  r  r  r>   )r|   r?   r  %Optional[CodecOptions[_DocumentType]]r  r  )r|   r?   r   r  r  list[_DocumentType])r|   r?   r  r   r  zlist[dict[str, Any]])r|   r?   r  r  r  r  )r|   r?   r  r  r  z0Union[list[dict[str, Any]], list[_DocumentType]])r  r	   r  r	   r  r  r  r>   )r|   zUnion[memoryview, bytes]r  rx   )r  r	   r  r   )r|   r	   r  r  r  r	   r  r  )r|   rx   r  r   r  Iterator[dict[str, Any]])r|   rx   r  r  r  Iterator[_DocumentType])r|   rx   r  r  r  8Union[Iterator[dict[str, Any]], Iterator[_DocumentType]])r  Union[BinaryIO, IO[bytes]]r  r   r  r  )r  r  r  r  r  r  )r  r  r  r  r  r  )r  rx   r  r  )r  r  )r  r   )r  
__future__r   datetimer!  osrp  r   r  uuidcodecsr   r   r   r(  collectionsr   _abctypingr   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   bson.binaryr   r   r   r   r   r   r   r    	bson.coder!   bson.codec_optionsr"   r#   r$   r%   bson.datetime_msr&   r'   r(   r)   r*   
bson.dbrefr+   bson.decimal128r,   bson.errorsr-   r.   r/   
bson.int64r0   bson.max_keyr2   bson.min_keyr4   bson.objectidr6   
bson.regexr7   bson.sonr8   r9   bson.timestampr:   bson.tz_utilr;   r  r=   bson.typingsr>   r?   r  r@   r  ImportError__all__rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   Structunpack_fromr   unpack_UNPACK_INTr   r   r   r   rV   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r   __annotations__r  r   r  r  r   r  packr1  r6  rP  r]  r  tupleranger   rW   r+  r-  r/  r4  r7  r?  rG  rK  rN  rQ  rU  rX  rZ  r`  rc  rf  rx  r~  r  r  r  r  r  r  r  rx   dictr  rb  listr   UUIDr  r  _typhasattrr  r  rA  r<  rz  r  r  rX   rY   r  rZ   r  r  r  r  r[   r\   r]   r^   r_   r  r  r   r   r~   <module>r.     sA  8r #   	 	  
  0 0 #    *	 	 	     & G G    "  ! $  -;F=~ 



















 #V]]4(44 fmmD!(( 6==&22 +fmmE2>> !FMM$'33 &u-99  =
==%(=25=?B=LO==b?
??%(?25??B?LO??b
bb$'b25b=NbWZbb"
$'25=NWZ*' 
' ' $'' 25' =N' ^a' ' T"
""%("36">O"Y\")"J-
--%(-25-?B-LO--
B

B
B%(
B25
B?B
BLO
B
BY
YY%(Y25Y=NYX[Y5Y 
  $' 25 =N ^a  	'
	'	'$'	'36	'>O	'_b	'	'
$'14<MWZ,
,,$',25,=N,^a,,3
33%(3253?B3LO33E
EE%(E25E?BELOEE8
88%(8258?B8LO88>L*>L+> L+> L*	>
 L+> L4> L(> L,> L)> L4> L*> L(> L)> L+> L#>  L(!>" L.#>$ L*L/L8L8+>: 2 
  


 
 	

  
 
 

*  --- - 	-
  - - 
-< TS12 
  (	
   ( 

  	
    	.K  
((M fmmD!&&FMM$$$	$v}}U+00 V]]4 %%
&--&++JeDkJJ;2$2./
DF"F
F%F37F?PF
FJN5)
;
//
M4OTC
P&

,	= ' #	
 	/ 
=  	,  
< 	J 	II| N 
< 	,  
=!" N#$ N	=] "LL/5	<  6Dt^$&/o""#6
 -9-- !"AX
AXAX AX 	AX
 AX AX AXH> LP;	;;&7;DH;
;. 
((M &&YZ 
 '<>>> %> 	>: 
 
 
 

 SWS
S*OS)SDK< 
$$K 
 
 

*E 
 SW,
,*O,5,B-H.* 
$*$H$H! *
*9*CF**Z 
 
 
 

 IM ,
 , E ,= ,F 
@D(9= 
 
(9T 
 <@,(,8, >,@&D+5 D+N
% 2!" B{3	 #e)  Fs   -\8 8]]