+
    8iv                      a  0 t $ R t^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t	^ RI
HtHtHtHtHtHtHtHt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 ^ RI H!t!H"t"H#t#H$t$H%t% ^ RI&H't' ^ R	I(H)t) ^ R
I*H+t+ ^ RI,H-t- ^ RI.H/t/ ^ RI0H1t1 ^ RI2H3t3 ^ RI4H5t5 ^ RI6H7t7 ^ RI8H9t9 R]Pt                  R]Pv                  R]Px                  R]Pz                  R]P|                  R]P~                  /t@ ! R R4      tA ! R R4      tB]'       d   ]]]C]3,          ,          tDM]tDRtE ! R R]D4      tF]F! ]BP                  R7      tHR]IR&    ]F! ]BP                  R7      tKR]IR &    ]F! ]BP                  R7      tMR]IR!&    ]MtNR]IR"&    R# R$ ltOR% R& ltP]N3R' R( lltQ]N3R) R* lltR]N3R+ R, lltSR- R. ltTR/ R0 ltUR1 R2 ltVR3 R4 ltWR5 R6 ltXR7 R8 ltYR9 R: ltZR; R< lt[R= R> lt\R? R@ lt]RA RB lt^RC RD lt_RE RF lt`RG RH ltaRI RJ ltbRK RL ltcRM RN ltdRO RP lteRQ RR ltfRS RT ltg/ RU]ZbRV]^bRW]YbRX]TbRY]dbRZ]ebR[]fbR\]\bR]]UbR^R_ bR`]abRa]gbRb]cbRc]_bRd]]bRe][bRf]`bRg]b/CthRh]IRi&   ]i! ]h4      tjRj Rk ltkRl Rm ltlRn Ro ltmRp Rq ltnRr Rs ltoRt Ru ltpRv Rw ltqRx Ry ltrRz R{ ltsR| R} lttR~ R ltuR R ltvR R ltwR R ltxR R ltyR R ltzR R lt{R R lt|/ ]}]ob]~]tb]P
                  ]sb]#]lb]]rb]]qb]C]ob]! R4      ]ob]	EP                  ]vb]]ub]+]nb]]mb]']zb]-]|b]/]{b]1]wb]3]pb]5]p]7]x])]y/CtR]IR&   / tR]IR&   ] F+  t]! ]R4      '       g   K  ]],          ]]EP                  &   K-  	  ];QJ d    . R ] 4       F  NK  	  5M! R ] 4       4      t]N3R R lltR R ltR R ltR R ltR R lt]1^]^]+^])^]7^]/^]-^/tR]IR&   ]C]]~]]P
                  ]]3]]']/tR]IR&   RR R lltR R ltR R ltR# )a\  Tools for using Python's :mod:`json` module with BSON documents.

This module provides two helper methods `dumps` and `loads` that wrap the
native :mod:`json` methods and provide explicit BSON conversion to and from
JSON. :class:`~bson.json_util.JSONOptions` provides a way to control how JSON
is emitted and parsed, with the default being the Relaxed Extended JSON format.
:mod:`~bson.json_util` can also generate Canonical or legacy `Extended JSON`_
when :const:`CANONICAL_JSON_OPTIONS` or :const:`LEGACY_JSON_OPTIONS` is
provided, respectively.

.. _Extended JSON: https://github.com/mongodb/specifications/blob/master/source/extended-json/extended-json.md

Example usage (deserialization):

.. doctest::

   >>> from bson.json_util import loads
   >>> loads(
   ...     '[{"foo": [1, 2]}, {"bar": {"hello": "world"}}, {"code": {"$scope": {}, "$code": "function x() { return 1; }"}}, {"bin": {"$type": "80", "$binary": "AQIDBA=="}}]'
   ... )
   [{'foo': [1, 2]}, {'bar': {'hello': 'world'}}, {'code': Code('function x() { return 1; }', {})}, {'bin': Binary(b'...', 128)}]

Example usage with :const:`RELAXED_JSON_OPTIONS` (the default):

.. doctest::

   >>> from bson import Binary, Code
   >>> from bson.json_util import dumps
   >>> dumps(
   ...     [
   ...         {"foo": [1, 2]},
   ...         {"bar": {"hello": "world"}},
   ...         {"code": Code("function x() { return 1; }")},
   ...         {"bin": Binary(b"")},
   ...     ]
   ... )
   '[{"foo": [1, 2]}, {"bar": {"hello": "world"}}, {"code": {"$code": "function x() { return 1; }"}}, {"bin": {"$binary": {"base64": "AQIDBA==", "subType": "00"}}}]'

Example usage (with :const:`CANONICAL_JSON_OPTIONS`):

.. doctest::

   >>> from bson import Binary, Code
   >>> from bson.json_util import dumps, CANONICAL_JSON_OPTIONS
   >>> dumps(
   ...     [
   ...         {"foo": [1, 2]},
   ...         {"bar": {"hello": "world"}},
   ...         {"code": Code("function x() { return 1; }")},
   ...         {"bin": Binary(b"")},
   ...     ],
   ...     json_options=CANONICAL_JSON_OPTIONS,
   ... )
   '[{"foo": [{"$numberInt": "1"}, {"$numberInt": "2"}]}, {"bar": {"hello": "world"}}, {"code": {"$code": "function x() { return 1; }"}}, {"bin": {"$binary": {"base64": "AQIDBA==", "subType": "00"}}}]'

Example usage (with :const:`LEGACY_JSON_OPTIONS`):

.. doctest::

   >>> from bson import Binary, Code
   >>> from bson.json_util import dumps, LEGACY_JSON_OPTIONS
   >>> dumps(
   ...     [
   ...         {"foo": [1, 2]},
   ...         {"bar": {"hello": "world"}},
   ...         {"code": Code("function x() { return 1; }", {})},
   ...         {"bin": Binary(b"")},
   ...     ],
   ...     json_options=LEGACY_JSON_OPTIONS,
   ... )
   '[{"foo": [1, 2]}, {"bar": {"hello": "world"}}, {"code": {"$code": "function x() { return 1; }", "$scope": {}}}, {"bin": {"$binary": "AQIDBA==", "$type": "00"}}]'

Alternatively, you can manually pass the `default` to :func:`json.dumps`.
It won't handle :class:`~bson.binary.Binary` and :class:`~bson.code.Code`
instances (as they are extended strings you can't provide custom defaults),
but it will be faster as there is less recursion.

.. note::
   If your application does not need the flexibility offered by
   :class:`JSONOptions` and spends a large amount of time in the `json_util`
   module, look to
   `python-bsonjs <https://pypi.python.org/pypi/python-bsonjs>`_ for a nice
   performance improvement. `python-bsonjs` is a fast BSON to MongoDB
   Extended JSON converter for Python built on top of
   `libbson <https://github.com/mongodb/libbson>`_. `python-bsonjs` works best
   with PyMongo when using :class:`~bson.raw_bson.RawBSONDocument`.
)annotationsN)TYPE_CHECKINGAnyCallableMappingMutableMappingOptionalSequenceTupleTypeUnioncast)ALL_UUID_SUBTYPESUUID_SUBTYPEBinaryUuidRepresentation)Code)CodecOptionsDatetimeConversion)_MAX_UTC_MSEPOCH_AWARE
DatetimeMS_datetime_to_millis_millis_to_datetime)DBRef)
Decimal128)Int64)MaxKey)MinKey)ObjectId)Regex)RE_TYPE	Timestamp)utcilmsuxc                  &    ] tR t^t^ t ^t ^tRtR# )DatetimeRepresentation N)__name__
__module____qualname____firstlineno__LEGACY
NUMBERLONGISO8601__static_attributes__r-       L/var/www/html/photoedit/myenv/lib/python3.14/site-packages/bson/json_util.pyr,   r,      s$    F J G	r6   r,   c                  &    ] tR t^t^ t ^t ^tRtR# )JSONModer-   N)r.   r/   r0   r1   r2   RELAXED	CANONICALr5   r-   r6   r7   r9   r9      s$    F G Ir6   r9   c                     a  ] tR t^t$ R]R&   R]R&   R]R&   R]R&   R]R&   R	 V 3R
 lltRRR]P                  3R V 3R llltR V 3R llt	R R lt
RtV ;t# )JSONOptionsint	json_modeboolstrict_number_longdatetime_representationstrict_uuidzType[MutableMapping[str, Any]]document_classc                    V ^8  d   QhRRRR/# )   argsr   kwargsr-   )formats   "r7   __annotate__JSONOptions.__annotate__   s     6 6c 6S 6r6   c                $   < \         SV `  4        R# )a  Encapsulates JSON options for :func:`dumps` and :func:`loads`.

:param strict_number_long: If ``True``, :class:`~bson.int64.Int64` objects
    are encoded to MongoDB Extended JSON's *Strict mode* type
    `NumberLong`, ie ``'{"$numberLong": "<number>" }'``. Otherwise they
    will be encoded as an `int`. Defaults to ``False``.
:param datetime_representation: The representation to use when encoding
    instances of :class:`datetime.datetime`. Defaults to
    :const:`~DatetimeRepresentation.LEGACY`.
:param strict_uuid: If ``True``, :class:`uuid.UUID` object are encoded to
    MongoDB Extended JSON's *Strict mode* type `Binary`. Otherwise it
    will be encoded as ``'{"$uuid": "<hex>" }'``. Defaults to ``False``.
:param json_mode: The :class:`JSONMode` to use when encoding BSON types to
    Extended JSON. Defaults to :const:`~JSONMode.LEGACY`.
:param document_class: BSON documents returned by :func:`loads` will be
    decoded to an instance of this class. Must be a subclass of
    :class:`collections.MutableMapping`. Defaults to :class:`dict`.
:param uuid_representation: The :class:`~bson.binary.UuidRepresentation`
    to use when encoding and decoding instances of :class:`uuid.UUID`.
    Defaults to :const:`~bson.binary.UuidRepresentation.UNSPECIFIED`.
:param tz_aware: If ``True``, MongoDB Extended JSON's *Strict mode* type
    `Date` will be decoded to timezone aware instances of
    :class:`datetime.datetime`. Otherwise they will be naive. Defaults
    to ``False``.
:param tzinfo: A :class:`datetime.tzinfo` subclass that specifies the
    timezone from which :class:`~datetime.datetime` objects should be
    decoded. Defaults to :const:`~bson.tz_util.utc`.
:param datetime_conversion: Specifies how UTC datetimes should be decoded
    within BSON. Valid options include 'datetime_ms' to return as a
    DatetimeMS, 'datetime' to return as a datetime.datetime and
    raising a ValueError for out-of-range values, 'datetime_auto' to
    return DatetimeMS objects when the underlying datetime is
    out-of-range and 'datetime_clamp' to clamp to the minimum and
    maximum possible datetimes. Defaults to 'datetime'. See
    `handling out of range datetimes <https://www.mongodb.com/docs/languages/python/pymongo-driver/current/data-formats/dates-and-times/#handling-out-of-range-datetimes>`_ for details.
:param args: arguments to :class:`~bson.codec_options.CodecOptions`
:param kwargs: arguments to :class:`~bson.codec_options.CodecOptions`

.. seealso:: The specification for Relaxed and Canonical `Extended JSON`_.

.. versionchanged:: 4.0
   The default for `json_mode` was changed from :const:`JSONMode.LEGACY`
   to :const:`JSONMode.RELAXED`.
   The default for `uuid_representation` was changed from
   :const:`~bson.binary.UuidRepresentation.PYTHON_LEGACY` to
   :const:`~bson.binary.UuidRepresentation.UNSPECIFIED`.

.. versionchanged:: 3.5
   Accepts the optional parameter `json_mode`.

.. versionchanged:: 4.0
   Changed default value of `tz_aware` to False.
N)super__init__)selfrG   rH   	__class__s   &*,r7   rN   JSONOptions.__init__   s    l 	r6   Nc               8    V ^8  d   QhRRRRRRRRRR	R
RRRRR/# )rF   clszType[JSONOptions]rA   zOptional[bool]rB   zOptional[int]rC   r?   r>   rG   r   rH   returnr=   r-   )rI   s   "r7   rJ   rK   1  sb     A AA*A "/A $	A
 A A A 
Ar6   c                	|  < VP                  R R4      VR &   VR ,          '       d   VP                  R\        4      VR&   V\        P                  \        P                  \        P
                  R39  d   \        R4      h\        \        \        SV `(  ! V .VO5/ VB 4      pV\        P                  \        P                  \        P                  39  d   \        R4      hWGn        VP                  \        P                  8X  dm   V'       d   \        R4      hVR\        P
                  39  d   \        R4      hVR9  d   \        R	4      hRVn        \        P
                  Vn        RVn        V# VP                  \        P                  8X  dl   VR9  d   \        R
4      hVR\        P                  39  d   \        R4      hVR9  d   \        R	4      hRVn        \        P                  Vn        RVn        V# RVn        \        P                  Vn        RVn        Ve   Wn        Ve   W'n        Ve   W7n        V# )tz_awareFtzinfoNznJSONOptions.datetime_representation must be one of LEGACY, NUMBERLONG, or ISO8601 from DatetimeRepresentation.zQJSONOptions.json_mode must be one of LEGACY, RELAXED, or CANONICAL from JSONMode.z<Cannot specify strict_number_long=True with JSONMode.RELAXEDz_datetime_representation must be DatetimeRepresentation.ISO8601 or omitted with JSONMode.RELAXEDTz6Cannot specify strict_uuid=False with JSONMode.RELAXEDz=Cannot specify strict_number_long=False with JSONMode.RELAXEDzbdatetime_representation must be DatetimeRepresentation.NUMBERLONG or omitted with JSONMode.RELAXED)NT)getr$   r,   r2   r3   r4   
ValueErrorr   r=   rM   __new__r9   r:   r;   r?   rA   rB   rC   )	rS   rA   rB   rC   r?   rG   rH   rO   rP   s	   &&&&&*, r7   rZ   JSONOptions.__new__1  s(    $ZZ
E:z*%zz(C8F8""))"--"**	+
 
 F  K!Ft!Fv!FGX__h.>.>@R@RSS.  #>>X---! !_``&t5K5S5S.TT ?  ,. !YZZ&+D#+A+I+ID(#D0 / ^^x111!5 !`aa&t5K5V5V.WW B  ,. !YZZ&*D#+A+L+LD(#D  ',D#+A+H+HD($D!-*<'&2/F,&#. r6   c                   V ^8  d   QhRR/# )rF   rT   strr-   )rI   s   "r7   rJ   rK   t  s     
 
 
r6   c           	     	   < R P                  V P                  V P                  V P                  V P                  \
        SV `  4       4      # )z[strict_number_long={!r}, datetime_representation={!r}, strict_uuid={!r}, json_mode={!r}, {})rI   rA   rB   rC   r?   rM   _arguments_repr)rO   rP   s   &r7   r_   JSONOptions._arguments_reprt  sD    3396'',,  ')4
	
r6   c                    V ^8  d   QhRRRR/# )rF   rH   r   rT   r=   r-   )rI   s   "r7   rJ   rK     s     # #S #[ #r6   c                    V P                  4       pR F   pVP                  V\        W4      4      W#&   K"  	  VP                  V4       \	        R/ VB # )a@  
Make a copy of this JSONOptions, overriding some options::

    >>> from bson.json_util import CANONICAL_JSON_OPTIONS
    >>> CANONICAL_JSON_OPTIONS.tz_aware
    True
    >>> json_options = CANONICAL_JSON_OPTIONS.with_options(tz_aware=False, tzinfo=None)
    >>> json_options.tz_aware
    False

.. versionadded:: 3.12
)rA   rB   rC   r?   r-   )_asdictrX   getattrupdater=   )rO   rH   optsopts   &,  r7   with_optionsJSONOptions.with_options  sK     ||~`C

3(:;DI aF"T""r6   )rB   r?   rA   rC   )r.   r/   r0   r1   __annotations__rN   r9   r:   rZ   r_   rh   r5   __classcell__)rP   s   @r7   r=   r=      s`    N  226 6t .215&*!))A AF
 
# #r6   r=   )r?   LEGACY_JSON_OPTIONSCANONICAL_JSON_OPTIONSRELAXED_JSON_OPTIONSDEFAULT_JSON_OPTIONSc               (    V ^8  d   QhRRRRRRRR/# )rF   objr   rG   rH   rT   r]   r-   )rI   s   "r7   rJ   rJ     s.     I Is I3 I# I# Ir6   c                t    VP                  R\        4      p\        P                  ! \	        W4      .VO5/ VB # )a%  Helper function that wraps :func:`json.dumps`.

Recursive function that handles all BSON types including
:class:`~bson.binary.Binary` and :class:`~bson.code.Code`.

:param json_options: A :class:`JSONOptions` instance used to modify the
    encoding of MongoDB Extended JSON types. Defaults to
    :const:`DEFAULT_JSON_OPTIONS`.

.. versionchanged:: 4.0
   Now outputs MongoDB Relaxed Extended JSON by default (using
   :const:`DEFAULT_JSON_OPTIONS`).

.. versionchanged:: 3.4
   Accepts optional parameter `json_options`. See :class:`JSONOptions`.
json_options)popro   jsondumps_json_convert)rq   rG   rH   rs   s   &*, r7   rv   rv     s3    " ::n.BCL::mC6HHHHr6   c               (    V ^8  d   QhRRRRRRRR/# )rF   r(   zUnion[str, bytes, bytearray]rG   r   rH   rT   r-   )rI   s   "r7   rJ   rJ     s)     * *) *# * * *r6   c                   a VP                  R\        4      oSP                  \        J d   V3R lVR&   M	V3R lVR&   \        P
                  ! V .VO5/ VB # )a  Helper function that wraps :func:`json.loads`.

Automatically passes the object_hook for BSON type conversion.

Raises ``TypeError``, ``ValueError``, ``KeyError``, or
:exc:`~bson.errors.InvalidId` on invalid MongoDB Extended JSON.

:param json_options: A :class:`JSONOptions` instance used to modify the
    decoding of MongoDB Extended JSON types. Defaults to
    :const:`DEFAULT_JSON_OPTIONS`.

.. versionchanged:: 4.0
   Now loads :class:`datetime.datetime` instances as naive by default. To
   load timezone aware instances utilize the `json_options` parameter.
   See :ref:`tz_aware_default_change` for an example.

.. versionchanged:: 3.5
   Parses Relaxed and Canonical Extended JSON as well as PyMongo's legacy
   format. Now raises ``TypeError`` or ``ValueError`` when parsing JSON
   type wrappers with values of the wrong type or any extra keys.

.. versionchanged:: 3.4
   Accepts optional parameter `json_options`. See :class:`JSONOptions`.
rs   c                   < \        V S4      # N)object_hookrq   rs   s   &r7   <lambda>loads.<locals>.<lambda>  s    K\,Jr6   r|   c                   < \        V S4      # r{   )object_pairs_hookpairsrs   s   &r7   r~   r     s    4Ee\4Zr6   r   )rt   ro   rD   dictru   loads)r(   rG   rH   rs   s   &*,@r7   r   r     sR    2 ::n.BCL""d* J}&Z"#::a)$)&))r6   c               $    V ^8  d   QhRRRRRR/# rF   rq   r   rs   r=   rT   r-   )rI   s   "r7   rJ   rJ     s"      s + QT r6   c           	     h   \        V R4      '       d/   V P                  4        UUu/ uF  w  r#V\        W14      bK  	  upp# \        V R4      '       d8   \        V \        \
        34      '       g   V  Uu. uF  p\        W14      NK  	  up#  \        W4      # u uppi u upi   \         d    T u # i ; i)zURecursive helper method that converts BSON types so they can be
converted into json.
items__iter__)hasattrr   rw   
isinstancer]   bytesdefault	TypeError)rq   rs   kvs   &&  r7   rw   rw     s     sG>AiikJkda=11kJJ	j	!	!*S3,*G*G8;<1a.<<s))	 K<  
s   B3B
B! !B10B1c               $    V ^8  d   QhRRRRRR/# )rF   r   zSequence[Tuple[str, Any]]rs   r=   rT   r   r-   )rI   s   "r7   rJ   rJ     s)     I I$I4?IIr6   c                8    \        VP                  V 4      V4      # r{   )r|   rD   r   s   &&r7   r   r     s     |2259<HHr6   c               $    V ^8  d   QhRRRRRR/# )rF   dctzMapping[str, Any]rs   r=   rT   r   r-   )rI   s   "r7   rJ   rJ     s#      & k ]` r6   c                p    R pV  F  pV\         9   g   K  Tp M	  V'       d   \        V,          ! W4      # V # r{   )_PARSERS_SET_PARSERS)r   rs   matchr   s   &&  r7   r|   r|     s:    EE  s11Jr6   c               $    V ^8  d   QhRRRRRR/# rF   docr   dummy0rT   r-   )rI   s   "r7   rJ   rJ     s!     	! 	!S 	!# 	!# 	!r6   c                    V R ,          p\        V\        \        34      '       g   V # ^ pV P                  RR4       F   pV\        P                  V^ 4      ,          pK"  	  \        W#4      # )$regex$options )r   r]   r   rX   _RE_OPT_TABLEr    )r   r   patternflagsrg   s   &&   r7   _parse_legacy_regexr     s]    (mGgU|,,
Ewwz2&""3** '  r6   c               $    V ^8  d   QhRRRRRR/# rF   r   r   rs   r=   rT   Union[Binary, uuid.UUID]r-   )rI   s   "r7   rJ   rJ     s"     	' 	'C 	'{ 	'?W 	'r6   c                n   \        V 4      ^8w  d   \        RV  24      h\        V R,          \        4      '       g   \        RV  24      hVP                  \
        P                  8X  d2   \        P                  ! \        P                  ! V R,          4      4      # \        P                  ! V R,          4      # )z*Decode a JSON legacy $uuid to Python UUID.zBad $uuid, extra field(s): $uuidz$uuid must be a string: )lenr   r   r]   uuid_representationr   UNSPECIFIEDr   	from_uuiduuidUUIDr   rs   s   &&r7   _parse_legacy_uuidr     s    
3x1}5cU;<<c'lC((23%899''+=+I+II		#g, 788yyW&&r6   c               (    V ^8  d   QhRRRRRRRR/# )	rF   datar   subtyper>   rs   r=   rT   r   r-   )rI   s   "r7   rJ   rJ   (  s)     ! !# ! !; !Kc !r6   c                p   V\         9   d   VP                  p\        W4      pV\        P                  8X  d   V# V\
        8X  d   \        P                  pM%V\        P                  8X  d   \        P                  pVP                  V4      # V^ 8X  d   \        \        P                  V 4      # \        W4      #     )r   r   r   r   r   r   STANDARDPYTHON_LEGACYas_uuidr   r   r   )r   r   rs   r   binary_values   &&&  r7   _binary_or_uuidr   (  s    ##*>>d,"4"@"@@l""4"="= $6$?$?? #5"B"B##$788!|DIIt$$$  r6   c               $    V ^8  d   QhRRRRRR/# r   r-   )rI   s   "r7   rJ   rJ   =  s"     8 8c 8 8AY 8r6   c                8   \        V R ,          \        4      '       d   RV R ,          ,          V R &   \        V R ,          ^4      pVR8  d   \        V R ,          R,          ^4      p\        P                  ! V R,          P	                  4       4      p\        W2V4      # )$type%02xl    :   NN$binary)r   r>   base64	b64decodeencoder   )r   rs   r   r   s   &&  r7   _parse_legacy_binaryr   =  s|    #g,$$G,G#g,#G*c'l2&+C	N1134D4,77r6   c               $    V ^8  d   QhRRRRRR/# r   r-   )rI   s   "r7   rJ   rJ   G  s'     A A AK AD\ Ar6   c                   V R ,          pVR,          pVR,          p\        V\        4      '       g   \        RV  24      h\        V\        4      '       d   \        V4      ^8  d   \        RV  24      h\        V4      ^8w  d   \        RV  24      h\        P
                  ! VP                  4       4      p\        V\        V^4      V4      # )r   r   subTypez!$binary base64 must be a string: z7$binary subType must be a string at most 2 characters: z=$binary must include only "base64" and "subType" components: )	r   r]   r   r   r   r   r   r   r>   )r   rs   binaryb64r   r   s   &&    r7   _parse_canonical_binaryr   G  s    ^F

CYGc3;C5ABBgs##s7|a'7QRUQVWXX
6{aWX[W\]^^CJJL)D4Wb!1<@@r6   c               $    V ^8  d   QhRRRRRR/# )rF   r   r   rs   r=   rT   z$Union[datetime.datetime, DatetimeMS]r-   )rI   s   "r7   rJ   rJ   V  s.     BR BR	BR'BR)BRr6   c                6   V R,          p\        V 4      ^8w  d   \        RV  24      h\        V\        4      '       Ed    VR,          R8X  d	   VRR pRpM^VR,          R9   d   VR,          R8X  d   VRR pVRR pM7VR,          R9   d   VRR pVRR pMVR,          R9   d   VRR pVRR pMTpRp VP                  R
4      p^ pVR8w  d#   \        \        W6R 4      R,          4      pVRV p\        P                  P                  VR4      P                  V\        R7      pV'       Ed   VR8w  d   \        V4      ^8X  dE   VR,          P                  R4      w  r\        V	4      R,          \        V
4      ^<,          ,           pMq\        V4      ^8X  d9   \        VR,          4      R,          \        VR,          4      ^<,          ,           pM)\        V4      ^8X  d   \        VR,          4      R,          pV^ ,          R8X  d
   XR,          pV\        P                  ! XR7      ,
          pVP                  '       dZ   VP                   '       d   VP#                  VP                   4      pVP$                  \&        P(                  8X  d   \+        V4      # V# VP                  RR7      pVP$                  \&        P(                  8X  d   \+        V4      # V# \-        \        V4      \/        RV4      4      #   \         d   p\        RT: R	24      ThRp?ii ; i)z3Decode a JSON datetime to python datetime.datetime.$datezBad $date, extra field(s): ZN-:r   z
time data z( does not match ISO-8601 datetime format.i@B %Y-%m-%dT%H:%M:%S)microsecondrW   :   NNi  :r      N:r   NN)secondsrW   zCodecOptions[Any]i)+r   )r   r   r   r]   
IndexErrorrY   rfindr>   floatdatetimestrptimereplacer$   split	timedeltarV   rW   
astimezonedatetime_conversionr   DATETIME_MSr   r   r   )r   rs   dtmdtoffsetexc	dot_indexr   awarehoursminutessecsaware_tzinfo_nones   &&           r7   _parse_canonical_datetimer   V  s    g,C
3x1}5cU;<<#s	d2w#~"XRJ&3r7c>"XRSRJ&"XRSRJ&"XRS
 HHSM	?eBzN3g=>KJYB!!**2/BCKK#C L 
 6fm6{a!'!1!1#!65zD(3w<"+<<V!6#;'$.VBZ21EEV!6#;'$.ayC
H..t<<E   """(()<)<=//3E3Q3QQ!%((L %T ://3E3Q3QQ!"344$$s3x.A<)PQQK  	dz#0XYZ`cc	ds0    K7 &K7 =K7 K7 /K7 7LLLc               $    V ^8  d   QhRRRRRR/# )rF   r   r   r   rT   r   r-   )rI   s   "r7   rJ   rJ     s!     ! !c !3 !8 !r6   c                b    \        V 4      ^8w  d   \        RV  24      h\        V R,          4      # )z1Decode a JSON ObjectId to bson.objectid.ObjectId.zBad $oid, extra field(s): $oid)r   r   r   r   r   s   &&r7   _parse_canonical_oidr     s/    
3x1}4SE:;;CK  r6   c               $    V ^8  d   QhRRRRRR/# )rF   r   r   r   rT   r]   r-   )rI   s   "r7   rJ   rJ     s!       c c r6   c                f    V R,          p\        V 4      ^8w  d   \        RV  24      h\        V4      # )z&Decode a JSON symbol to Python string.$symbolzBad $symbol, extra field(s): )r   r   r]   )r   r   symbols   && r7   _parse_canonical_symbolr     s3    ^F
3x1}7u=>>v;r6   c               $    V ^8  d   QhRRRRRR/# )rF   r   r   r   rT   r   r-   )rI   s   "r7   rJ   rJ     s!     7 7s 7C 7D 7r6   c                    V  F  pVR9  g   K  \        RV  24      h	  \        V R,          V P                  R4      R7      # )z%Decode a JSON code to bson.code.Code.$code$scopezBad $code, extra field(s): )scope)r  r  )r   r   rX   )r   r   keys   && r7   _parse_canonical_coder    sD    ))9#?@@  GCGGH$566r6   c               $    V ^8  d   QhRRRRRR/# )rF   r   r   r   rT   z
Regex[str]r-   )rI   s   "r7   rJ   rJ     s!     ) ) )S )Z )r6   c                &   V R,          p\        V 4      ^8w  d   \        RV  24      h\        V4      ^8w  d   \        RV  24      hVR,          p\        V\        4      '       g   \        R\	        V4      ,          4      h\        VR,          V4      # )z(Decode a JSON regex to bson.regex.Regex.$regularExpressionz(Bad $regularExpression, extra field(s): zLBad $regularExpression must include only "pattern and "options" components: optionszCBad $regularExpression options, options must be string, was type %sr   )r   r   r   r]   typer    )r   r   regexrf   s   &&  r7   _parse_canonical_regexr    s    $%E
3x1}B3%HII
5zQZ[^Z_`
 	
 DdC  QUYZ^U_`
 	
 y!4((r6   c               $    V ^8  d   QhRRRRRR/# r   r-   )rI   s   "r7   rJ   rJ     s!       S S r6   c                8   \        V P                  R4      \        4      '       du   RV 9   dn   \        V P                  R4      \        \        R4      34      '       d>   \	        V P                  R4      V P                  R4      3RV P                  RR4      /V B # V # )z(Decode a JSON DBRef to bson.dbref.DBRef.$refz$idz$dbNdatabase)r   rX   r]   r
  r   rt   r   s   &&r7   _parse_canonical_dbrefr    sv     	3776?C((SLswwu~T$Z'899SWWV_cggen[swwud?S[WZ[[Jr6   c               $    V ^8  d   QhRRRRRR/# r   r-   )rI   s   "r7   rJ   rJ     s&     D DC D D Dr6   c                   V R,          p\        V 4      ^8w  d   \        RV  24      h\        V\        4      '       d{   VP	                  4       pVP
                  e   \        RV 24      h\        VP                  \        4      '       g   \        RV 24      h\        V4      ^8w  d   \        RV 24      hV# \        RV  24      h)z9Decode a JSON (deprecated) DBPointer to bson.dbref.DBRef.
$dbPointerz Bad $dbPointer, extra field(s): z!Bad $dbPointer, extra field $db: z)Bad $dbPointer, $id must be an ObjectId: z)Bad $dbPointer, extra field(s) in DBRef: z"Bad $dbPointer, expected a DBRef: )r   r   r   r   as_docr  idr   )r   r   dbref	dbref_docs   &&  r7   _parse_canonical_dbpointerr    s    E
3x1}:3%@AA%LLN	>>%?	{KLL%((H--G	{STTy>QG	{STT<SEBCCr6   c               $    V ^8  d   QhRRRRRR/# )rF   r   r   r   rT   r>   r-   )rI   s   "r7   rJ   rJ     s!       S S r6   c                    V R,          p\        V 4      ^8w  d   \        RV  24      h\        V\        4      '       g   \        RV  24      h\	        V4      # )z"Decode a JSON int32 to python int.
$numberIntz Bad $numberInt, extra field(s): z$numberInt must be string: )r   r   r   r]   r>   )r   r   i_strs   && r7   _parse_canonical_int32r    sT    E
3x1}:3%@AAeS!!5cU;<<u:r6   c               $    V ^8  d   QhRRRRRR/# )rF   r   r   r   rT   r   r-   )rI   s   "r7   rJ   rJ     s!       S U r6   c                f    V R,          p\        V 4      ^8w  d   \        RV  24      h\        V4      # )z(Decode a JSON int64 to bson.int64.Int64.$numberLongz!Bad $numberLong, extra field(s): )r   r   r   )r   r   l_strs   && r7   _parse_canonical_int64r#    s4    E
3x1};C5ABB<r6   c               $    V ^8  d   QhRRRRRR/# )rF   r   r   r   rT   r   r-   )rI   s   "r7   rJ   rJ     s!       c e r6   c                    V R,          p\        V 4      ^8w  d   \        RV  24      h\        V\        4      '       g   \        RV  24      h\	        V4      # )z%Decode a JSON double to python float.$numberDoublez#Bad $numberDouble, extra field(s): z$numberDouble must be string: )r   r   r   r]   r   r   r   d_strs   && r7   _parse_canonical_doubler)    sT     E
3x1}=cUCDDeS!!8>??<r6   c               $    V ^8  d   QhRRRRRR/# )rF   r   r   r   rT   r   r-   )rI   s   "r7   rJ   rJ     s!      S # * r6   c                    V R,          p\        V 4      ^8w  d   \        RV  24      h\        V\        4      '       g   \        RV  24      h\	        V4      # )z7Decode a JSON decimal128 to bson.decimal128.Decimal128.$numberDecimalz$Bad $numberDecimal, extra field(s): z$numberDecimal must be string: )r   r   r   r]   r   r'  s   && r7   _parse_canonical_decimal128r-    sV     !E
3x1}>seDEEeS!!9#?@@er6   c               $    V ^8  d   QhRRRRRR/# )rF   r   r   r   rT   r   r-   )rI   s   "r7   rJ   rJ     !       c f r6   c                    \        V R,          4      \        Jg   V R,          ^8w  d   \        RV  24      h\        V 4      ^8w  d   \        RV  24      h\	        4       # )z,Decode a JSON MinKey to bson.min_key.MinKey.$minKeyz$minKey value must be 1: Bad $minKey, extra field(s): )r
  r>   r   r   r   r   s   &&r7   _parse_canonical_minkeyr3    sV    C	N3&#i.A*=3C59::
3x1}7u=>>8Or6   c               $    V ^8  d   QhRRRRRR/# )rF   r   r   r   rT   r   r-   )rI   s   "r7   rJ   rJ     r/  r6   c                    \        V R,          4      \        Jg   V R,          ^8w  d   \        RV 34      h\        V 4      ^8w  d   \        RV  24      h\	        4       # )z,Decode a JSON MaxKey to bson.max_key.MaxKey.$maxKeyz$maxKey value must be 1: %sr2  )r
  r>   r   r   r   r   s   &&r7   _parse_canonical_maxkeyr7    sS    C	N3&#i.A*=5v>>
3x1}7u=>>8Or6   c               $    V ^8  d   QhRRRRRR/# r   r-   )rI   s   "r7   rJ   rJ     s"     : :s :+ ::R :r6   c                <    R V 9   d   \        W4      # \        W4      # )r   )r   r   r   s   &&r7   _parse_binaryr:    s    #~#C66&s99r6   c               $    V ^8  d   QhRRRRRR/# )rF   r   r   r   rT   r#   r-   )rI   s   "r7   rJ   rJ      s!     ) )# )s )y )r6   c                H    V R ,          p\        VR,          VR,          4      # 
$timestamptr%   r"   )r   r   tsps   && r7   _parse_timestamprA     s!    
l
CSXs3x((r6   r   r  r   r   r1  r6  r   r  r   z
$undefinedc                    R # r{   r-   )__1s   &&r7   r~   r~   /  s    r6   r!  r>  r,  r  r  r   r  r&  z,dict[str, Callable[[Any, JSONOptions], Any]]r   c               (    V ^8  d   QhRRRRRRRR/# )	rF   r   r   r   r>   rs   r=   rT   r   r-   )rI   s   "r7   rJ   rJ   <  s.     a a a aK aC ar6   c                    VP                   \        P                  8X  d0   R \        P                  ! V 4      P                  4       RRV,          /# R R\        P                  ! V 4      P                  4       RRV,          //# )r   r   r   r   r   )r?   r9   r2   r   	b64encodedecode)r   r   rs   s   &&&r7   _encode_binaryrI  <  sj    06++D188:GVgEUVV&"2"24"8"?"?"A9fW^N^_``r6   c               $    V ^8  d   QhRRRRRR/# rF   rq   r   rs   r=   rT   r   r-   )rI   s   "r7   rJ   rJ   B  s!     5 5C 5{ 5t 5r6   c                :   VP                   \        P                  8X  d:   ^ \        V 4      u;8:  d   \        8:  d   M M\        V P                  4       V4      # VP                   \        P                  8X  d   R\        V 4      /# RR\        \        V 4      4      //# )r   r   r!  )	rB   r,   r4   r>   r   _encode_datetimeas_datetimer2   r]   r}   s   &&r7   _encode_datetimemsrO  B  sx    ,,0F0N0NNS([( 1<@@		-	-1G1N1N	NS""mSS]344r6   c               $    V ^8  d   QhRRRRRR/# )rF   rq   r   rs   r=   rT   r   r-   )rI   s   "r7   rJ   rJ   M  s&     U Ud U+ U$ Ur6   c                ~    V P                   f   R\        V 4      /# R\        V 4      R\        V P                   V4      /# )Nr  r  )r  r]   rw   r}   s   &&r7   _encode_coderR  M  s9    
yyS""S8]399l-STTr6   c               $    V ^8  d   QhRRRRRR/# )rF   rq   r   rs   r=   rT   r   r-   )rI   s   "r7   rJ   rJ   T  s!      u K C r6   c                V    VP                   '       d   R \        V 4      /# \        V 4      # )r!  )rA   r]   r>   r}   s   &&r7   _encode_int64rU  T  s&    &&&s3x((3xr6   c               $    V ^8  d   QhRRRRRR/# )rF   rq   r   r   rT   r-   )rI   s   "r7   rJ   rJ   [  s!      c 3 3 r6   c                    V # r{   r-   rq   r   s   &&r7   _encode_nooprY  [  s    Jr6   c               $    V ^8  d   QhRRRRRR/# rK  r-   )rI   s   "r7   rJ   rJ   _  s&     J Js J+ J$ Jr6   c                0   R pV P                   \        P                  ,          '       d
   VR,          pV P                   \        P                  ,          '       d
   VR,          pV P                   \        P                  ,          '       d
   VR,          pV P                   \        P
                  ,          '       d
   VR,          pV P                   \        P                  ,          '       d
   VR,          pV P                   \        P                  ,          '       d
   VR,          p\        V P                  \        4      '       d   V P                  pMV P                  P                  R4      pVP                  \        P                  8X  d   RVR	V/# R
RVRV//# )r   r%   r&   r'   r(   r)   r*   zutf-8r   r   r  r   r	  )r   re
IGNORECASELOCALE	MULTILINEDOTALLUNICODEVERBOSEr   r   r]   rH  r?   r9   r2   )rq   rs   r   r   s   &&  r7   _encode_regexrc  _  s   E
yy2==  
yy299
yy2<<
yy299
yy2::
yy2::#++s##++++$$W-0':u55 9gy%"HIIr6   c               $    V ^8  d   QhRRRRRR/# )rF   rq   r>   rs   r=   rT   r   r-   )rI   s   "r7   rJ   rJ   v  s!      S   r6   c                    VP                   \        P                  8X  d6   \        ) T u;8:  d   \        8  d   M MR \	        V 4      /# R\	        V 4      /# V # )r  r!  )r?   r9   r;   
_INT32_MAXr]   r}   s   &&r7   _encode_intrg  v  sH    !3!33;#*
* #c(++s3x((Jr6   c               $    V ^8  d   QhRRRRRR/# )rF   rq   r   rs   r=   rT   r   r-   )rI   s   "r7   rJ   rJ   ~  s!      u K C r6   c                D   VP                   \        P                  8w  d   \        P                  ! V 4      '       d   R R/# \        P
                  ! V 4      '       d   V ^ 8  d   RMRpR V/# VP                   \        P                  8X  d   R \        \        V 4      4      /# V # )r&  NaNInfinityz	-Infinity)	r?   r9   r2   mathisnanisinfr;   r]   repr)rq   rs   representations   && r7   _encode_floatrq  ~  s    0::c??#U++ZZ__+.7ZN#^44##x'9'99 $Sc^44Jr6   c               $    V ^8  d   QhRRRRRR/# )rF   rq   datetime.datetimers   r=   rT   r   r-   )rI   s   "r7   rJ   rJ     s"     3 3+ 3; 34 3r6   c                   VP                   \        P                  8X  d   V P                  '       g'   V P	                  \
        R 7      p V P                  f   Q hV \        8  d   V P                  P                  V 4      pVP                  VP                  VP                  3R
8X  d   RpMV P                  R4      p\        V P                  R,          4      pV'       d   RV3,          MRpRRP                  V P                  R4      WS4      /# \        V 4      pVP                   \        P                   8X  d   RV/# RR	\#        V4      //# )r   r   z%zi  z.%03dr   r   z{}{}{}r   r!  )r   r   r   )rB   r,   r4   rW   r   r$   r   	utcoffsetdaysr   microsecondsstrftimer>   r   rI   r   r2   r]   )rq   rs   off	tz_stringmillisfracsecss   &&    r7   rM  rM    s   ++/E/M/MMzzz++S+)C::)))+**&&s+C#++s'7'78IE	LL.	4/0F.4w&*"H6I)JH`  !%F++/E/L/LL  mS[122r6   c               $    V ^8  d   QhRRRRRR/# )rF   rq   r   rs   r=   rT   r   r-   )rI   s   "r7   rJ   rJ     s!     0 0u 0K 0D 0r6   c                    \        V ^ V4      # r   )rI  r}   s   &&r7   _encode_bytesr    s    #q,//r6   c               $    V ^8  d   QhRRRRRR/# )rF   rq   r   rs   r=   rT   r   r-   )rI   s   "r7   rJ   rJ     s!     : :F :+ :$ :r6   c                .    \        W P                  V4      # r{   )rI  r   r}   s   &&r7   _encode_binary_objr    s    #{{L99r6   c               $    V ^8  d   QhRRRRRR/# )rF   rq   z	uuid.UUIDrs   r=   rT   r   r-   )rI   s   "r7   rJ   rJ     s!     " "i "{ "t "r6   c                    VP                   '       d8   \        P                  ! WP                  R 7      p\	        W"P
                  V4      # RV P                  /# ))r   r   )rC   r   r   r   rI  r   hex)rq   rs   binvals   && r7   _encode_uuidr    sD    !!#;[;[\fnnlCC!!r6   c               $    V ^8  d   QhRRRRRR/# )rF   rq   r   r   r   rT   r   r-   )rI   s   "r7   rJ   rJ     s!      ( C D r6   c                    R \        V 4      /# )r   r]   rX  s   &&r7   _encode_objectidr    s    CHr6   c               $    V ^8  d   QhRRRRRR/# rF   rq   r#   r   r   rT   r   r-   )rI   s   "r7   rJ   rJ     s!     9 99 9c 9d 9r6   c                :    R RV P                   RV P                  //# r=  )timeincrX  s   &&r7   _encode_timestampr    s    3#sww788r6   c               $    V ^8  d   QhRRRRRR/# r  r-   )rI   s   "r7   rJ   rJ     s!     ( (I (s (t (r6   c                    R \        V 4      /# )r,  r  rX  s   &&r7   _encode_decimal128r    s    c#h''r6   c               $    V ^8  d   QhRRRRRR/# )rF   rq   r   rs   r=   rT   r   r-   )rI   s   "r7   rJ   rJ     s&     B Bu BK BD Br6   c                8    \        V P                  4       VR 7      # ))rs   )rw   r  r}   s   &&r7   _encode_dbrefr    s    LAAr6   c               $    V ^8  d   QhRRRRRR/# rF   r   r   dummy1rT   r   r-   )rI   s   "r7   rJ   rJ     !      3   r6   c                
    R ^/# )r1  r-   r   r  s   &&r7   _encode_minkeyr        q>r6   c               $    V ^8  d   QhRRRRRR/# r  r-   )rI   s   "r7   rJ   rJ     r  r6   c                
    R ^/# )r6  r-   r  s   &&r7   _encode_maxkeyr    r  r6   z-dict[Type, Callable[[Any, JSONOptions], Any]]	_ENCODERSz,dict[int, Callable[[Any, JSONOptions], Any]]_MARKERS_type_markerc              #  $   "   T F  qx  K  	  R # 5ir{   r-   ).0r?  s   & r7   	<genexpr>r    s     -9a9s   c               $    V ^8  d   QhRRRRRR/# r   r-   )rI   s   "r7   rJ   rJ     s!     9 9 9K 93 9r6   c                    \         \        V 4      ,          ! W4      #   \         d     Mi ; i\        T R 4      '       d?   T P                  pT\
        9   d(   \
        T,          pT\         \        T 4      &   T! Y4      # \         F=  p\        Y4      '       g   K  \         T,          pT\         \        T 4      &   T! Y4      u # 	  \        RT ,          4      h)r  z%r is not JSON serializable)	r  r
  KeyErrorr   r  r  _BUILT_IN_TYPESr   r   )rq   rs   markerfuncbases   &&   r7   r   r     s    c#C66  sN##!!XF#D#'Id3i **  c  T?D#'Id3i **   1C7
88s    ,,c                    V ^8  d   QhRRRR/# )rF   rq   r   rT   r>   r-   )rI   s   "r7   rJ   rJ     s      s s r6   c                    \        V 4      # r{   )r   rq   s   &r7   _get_str_sizer    s    s8Or6   c                    V ^8  d   QhRRRR/# )rF   rq   rs  rT   r>   r-   )rI   s   "r7   rJ   rJ     s     $ $- $# $r6   c                T    ^\        \        V P                  4       4      4      ,           # )   )r   r]   r  r  s   &r7   _get_datetime_sizer    s    s3sxxz?###r6   c                    V ^8  d   QhRRRR/# )rF   rq   r    rT   r>   r-   )rI   s   "r7   rJ   rJ     s     ! ! !3 !r6   c                :    ^\        V P                  4      ,           # )   )r   r   r  s   &r7   _get_regex_sizer    s    CKK   r6   c                    V ^8  d   QhRRRR/# )rF   rq   r   rT   r>   r-   )rI   s   "r7   rJ   rJ     s     $ $ $3 $r6   c                :    ^"\        V P                  4      ,           # )"   )r   
collectionr  s   &r7   _get_dbref_sizer    s    CNN###r6   zdict[Any, int]_CONSTANT_SIZE_TABLEzdict[Any, Callable[[Any], int]]_VARIABLE_SIZE_TABLEc               (    V ^8  d   QhRRRRRRRR/# )rF   rq   r   max_sizer>   current_sizerT   r-   )rI   s   "r7   rJ   rJ   1  s(     & &# & &C & &r6   c                   W!8  d   V# \        V 4      p \        V,          #   \         d     Mi ; i \        T,          ! T 4      #   \         d     Mi ; iT\        8X  d   T P
                  '       dQ   T^\        T P
                  Y4      ,           \        T 4      ,           \        T P
                  4      ,
          ,          pT# T^\        T 4      ,           ,          p T# T\        8X  dL   T P                  4        F5  w  rET\        YAT4      ,          pT\        YQT4      ,          pY!8  g   K3  Tu # 	  T# \        T R4      '       d'   T  F   pT\        YaT4      ,          pY!8  g   K  Tu # 	  T# )z!Recursively finds size of objectsr   )r
  r  r  r  r   r  get_sizer   r   r   r   )rq   r  r  obj_typer   r   r%   s   &&&    r7   r  r  1  s]   CyH#H-- #H-c22  4999HSYY??#c(JSQTQZQZ^[L   ACL(L  
T	IIKDAHQ,??LHQ,??L'##	    
j	!	!AHQ,??L'##  s   " 00A AAc               $    V ^8  d   QhRRRRRR/# )rF   rq   r   
max_lengthr>   rT   Tuple[Any, int]r-   )rI   s   "r7   rJ   rJ   Z  s!     ) )S )c )o )r6   c                   V^ 8:  d   R# Tp\        V R4      '       dC   / pV P                  4        F)  w  rE\        WR4      w  rbV'       d   WcV&   V^ 8:  g   K'   W23# 	  W23# \        V R4      '       d\   \        V \        \
        34      '       g@   . pV  F4  p\        WR4      w  rbV'       d   VP                  V4       V^ 8:  g   K2   W23# 	  W23# \        W4      # )zMRecursively truncate documents as needed to fit inside max_length characters.r   r   )Nr   )r   r   _truncate_documentsr   r]   r   append	_truncate)rq   r  	remaining	truncatedr   r   truncated_vs   &&     r7   r  r  Z  s    QIsG	IIKDA%8%F"K*!A~##   ##	j	!	!*S3,*G*G	A%8%F"K  -A~##  ##((r6   c               $    V ^8  d   QhRRRRRR/# )rF   rq   r   r  r>   rT   r  r-   )rI   s   "r7   rJ   rJ   u  s!     
+ 
+3 
+3 
+? 
+r6   c                ~    \        W4      pW!8:  d   WV,
          3#  V R V pW1V,
          3#   \         d    T p Li ; ir{   )r  r   )rq   r  sizer  s   &&  r7   r  r  u  sV    C#D$$$	JYI d***  	I	s   , <<l        r   )__conditional_annotations____doc__
__future__r   r   r   ru   rl  r\  r   typingr   r   r   r   r   r   r	   r
   r   r   r   bson.binaryr   r   r   r   	bson.coder   bson.codec_optionsr   r   bson.datetime_msr   r   r   r   r   
bson.dbrefr   bson.decimal128r   
bson.int64r   bson.max_keyr   bson.min_keyr   bson.objectidr   
bson.regexr    bson.sonr!   bson.timestampr#   bson.tz_utilr$   ILMSUXr   r,   r9   r]   _BASE_CLASSrf  r=   r2   rl   rj   r;   rm   r:   rn   ro   rv   r   rw   r   r|   r   r   r   r   r   r   r   r   r  r  r  r  r  r#  r)  r-  r3  r7  r:  rA  r   setr   rI  rO  rR  rU  rY  rc  rg  rq  rM  r  r  r  r  r  r  r  r  r  r@   r   r   r>   r
  r   r  r  _typr   r  tupler  r   r  r  r  r  r  r  r  r  r  )r  s   @r7   <module>r     sB  Vn #     	     T S  ?   &    "   $  ! !H( (V ~c3h78KK
`#+ `#F $/#I [ I '2H<N<N&O  O %0(:J:J$K k K %9 k 8	I**D 9M  CWI EY 	!	'!*8ABRJ!7)"D&:)
:
 :
": &: !	:
 &: &: }: ": : $: ): ": 1: ,: 0:  &!:" (#:$ ,%:
6 ( 8}a5UJ.3.0:"9(B<,<	=< '< "	<
 
=< < < 	J< 	II|< < 
=< 	,< 
=< N< N<  !<" 
=#<$ ] ")<	8 0 :<
6 ;Dt^$$&/o""#  %-9-%%-9-- 3G 9>$!$
 b	2r
A
A( n  	=)	?	?9 5 &R)6
+r6   