Ë
    ™V.jw  ã                   ó\   — d Z ddlmZ dZ G d„ d«      Zdd„Z G d„ d	«      Z G d
„ d«      Zy)z7Object related utilities, including introspection, etc.é    )Úreduce)ÚBunchÚFallbackContextÚgetitem_propertyÚ
mro_lookupc                   ó   — e Zd ZdZd„ Zy)r   z-Object that enables you to modify attributes.c                 ó:   — | j                   j                  |«       y ©N)Ú__dict__Úupdate)ÚselfÚkwargss     úVC:\xampp\htdocs\tradingbinance\backend\.venv\Lib\site-packages\celery/utils/objects.pyÚ__init__zBunch.__init__
   s   € Ø�‰×Ñ˜VÕ$ó    N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   © r   r   r   r      s
   „ Ù7ó%r   r   Nc                 óú   — |s
t        «       n|}|sg n|}| j                  «       D ]>  }||v r&	 |j                  |   }|j                  }||vr|c S  y||j                  v sŒ<|c S  y# t        t
        f$ r Y  yw xY w)a  Return the first node by MRO order that defines an attribute.

    Arguments:
        cls (Any): Child class to traverse.
        attr (str): Name of attribute to find.
        stop (Set[Any]): A set of types that if reached will stop
            the search.
        monkey_patched (Sequence): Use one of the stop classes
            if the attributes module origin isn't in this list.
            Used to detect monkey patched attributes.

    Returns:
        Any: The attribute value, or :const:`None` if not found.
    N)ÚsetÚmror   r   ÚAttributeErrorÚKeyError)ÚclsÚattrÚstopÚmonkey_patchedÚnodeÚvalueÚmodule_origins          r   r   r      sŽ   € ñ Œ3Œ5 $€DÙ-‘R°>€NØ—‘–	ˆØ�4‰<ð ØŸ™ dÑ+�Ø %× 0Ñ 0�ð !¨Ñ6Ø’KÙØ�4—=‘=Ò ØŠKñ øô
 #¤HÐ-ò Øñ ðús   ­A'Á'A:Á9A:c                   ó"   — e Zd ZdZd„ Zd„ Zd„ Zy)r   a¹  Context workaround.

    The built-in ``@contextmanager`` utility does not work well
    when wrapping other contexts, as the traceback is wrong when
    the wrapped context raises.

    This solves this problem and can be used instead of ``@contextmanager``
    in this example::

        @contextmanager
        def connection_or_default_connection(connection=None):
            if connection:
                # user already has a connection, shouldn't close
                # after use
                yield connection
            else:
                # must've new connection, and also close the connection
                # after the block returns
                with create_new_connection() as connection:
                    yield connection

    This wrapper can be used instead for the above like this::

        def connection_or_default_connection(connection=None):
            return FallbackContext(connection, create_new_connection)
    c                 óJ   — || _         || _        || _        || _        d | _        y r
   )ÚprovidedÚfallbackÚfb_argsÚ	fb_kwargsÚ_context)r   r%   r&   r'   r(   s        r   r   zFallbackContext.__init__J   s%   € Ø ˆŒØ ˆŒØˆŒØ"ˆŒØˆ�r   c                 ó¬   — | j                   �| j                   S  | j                  | j                  i | j                  ¤Žj	                  «       x}| _        |S r
   )r%   r&   r'   r(   Ú	__enter__r)   )r   Úcontexts     r   r+   zFallbackContext.__enter__Q   sP   € Ø�=‰=Ð$Ø—=‘=Ð Ø"/ $§-¡-Ø�\‰\ð#
Ø!Ÿ^™^ñ#
ç
‰)‹+ð	ˆ�$”-ð ˆr   c                 óN   — | j                   � | j                   j                  |Ž S y r
   )r)   Ú__exit__)r   Úexc_infos     r   r.   zFallbackContext.__exit__Y   s(   € Ø�=‰=Ð$Ø)�4—=‘=×)Ñ)¨8Ð4Ð4ð %r   N)r   r   r   r   r   r+   r.   r   r   r   r   r   .   s   „ ñò6òó5r   r   c                   ó,   — e Zd ZdZdd„Zd„ Zdd„Zd„ Zy)r   a–  Attribute -> dict key descriptor.

    The target object must support ``__getitem__``,
    and optionally ``__setitem__``.

    Example:
        >>> from collections import defaultdict

        >>> class Me(dict):
        ...     deep = defaultdict(dict)
        ...
        ...     foo = _getitem_property('foo')
        ...     deep_thing = _getitem_property('deep.thing')


        >>> me = Me()
        >>> me.foo
        None

        >>> me.foo = 10
        >>> me.foo
        10
        >>> me['foo']
        10

        >>> me.deep_thing = 42
        >>> me.deep_thing
        42
        >>> me.deep
        defaultdict(<type 'dict'>, {'thing': 42})
    Nc                 óz   — |j                  d«      \  }}| _        |r|j                  d«      nd | _        || _        y )NÚ.)Ú
rpartitionÚkeyÚsplitÚpathr   )r   ÚkeypathÚdocr6   Ú_s        r   r   zgetitem_property.__init__   s5   € Ø#×.Ñ.¨sÓ3Ñˆˆa�”Ù'+�D—J‘J˜s”O°ˆŒ	Øˆ�r   c                 óT   — | j                   rt        d„ |g| j                   z   «      S |S )Nc                 ó   — | |   S r
   r   )ÚdÚks     r   Ú<lambda>z(getitem_property._path.<locals>.<lambda>…   s   €  A a¢Dr   )r6   r   )r   Úobjs     r   Ú_pathzgetitem_property._path„   s+   € Ø@DÇ	Â	”Ñ(¨3¨%°$·)±)Ñ*;Ó<ð 	Øð	r   c                 ó^   — |€|S | j                  |«      j                  | j                  «      S r
   )r@   Úgetr4   )r   r?   Útypes      r   Ú__get__zgetitem_property.__get__ˆ   s)   € Øˆ;ØˆKØ�z‰z˜#‹×"Ñ" 4§8¡8Ó,Ð,r   c                 ó@   — || j                  |«      | j                  <   y r
   )r@   r4   )r   r?   r!   s      r   Ú__set__zgetitem_property.__set__�   s   € Ø$)ˆ�
‰
�3‹˜Ÿ™Ò!r   r
   )r   r   r   r   r   r@   rD   rF   r   r   r   r   r   ^   s   „ ñó@ò
ó-ó
*r   r   )NN)r   Ú	functoolsr   Ú__all__r   r   r   r   r   r   r   Ú<module>rI      s5   ðÙ =Ý à
H€÷%ñ %ó÷@-5ñ -5÷`0*ò 0*r   