Yohohohohohooho | Sanrei Aya
Sanrei Aya


Server : LiteSpeed
System : Linux barito.iixcp.rumahweb.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64
User : elvh3918 ( 1528)
PHP Version : 8.2.31
Disable Function : mail
Directory :  /usr/local/lib/python3.9/site-packages/celery/utils/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/local/lib/python3.9/site-packages/celery/utils/__pycache__/objects.cpython-39.pyc
a

��Shw�@sLdZddlmZdZGdd�d�Zd
dd�ZGd	d
�d
�ZGdd�d�ZdS)z7Object related utilities, including introspection, etc.�)�reduce)�Bunch�FallbackContext�getitem_property�
mro_lookupc@seZdZdZdd�ZdS)rz-Object that enables you to modify attributes.cKs|j�|�dS�N)�__dict__�update)�self�kwargs�r�>/usr/local/lib/python3.9/site-packages/celery/utils/objects.py�__init__
szBunch.__init__N)�__name__�
__module__�__qualname__�__doc__rrrrr
rsrNc
Cs�|s
t�n|}|sgn|}|��D]`}||vrpz|j|}|j}WnttfyXYn0||vrj|SdS||jvr"|Sq"dS)aReturn 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�mrorr�AttributeError�KeyError)�cls�attr�stopZmonkey_patched�node�valueZ
module_originrrr
rs


rc@s(eZdZdZdd�Zdd�Zdd�ZdS)	ra�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)
    cOs"||_||_||_||_d|_dSr)�provided�fallback�fb_args�	fb_kwargs�_context)r
rrrrrrr
rJs
zFallbackContext.__init__cCs2|jdur|jS|j|ji|j����}|_|Sr)rrrr�	__enter__r )r
�contextrrr
r!Qs
��zFallbackContext.__enter__cGs|jdur|jj|�SdSr)r �__exit__)r
�exc_inforrr
r#Ys
zFallbackContext.__exit__N)rrrrrr!r#rrrr
r.src@s4eZdZdZddd�Zdd�Zddd�Zd	d
�ZdS)
ra�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})
    NcCs0|�d�\}}|_|r |�d�nd|_||_dS)N�.)�
rpartition�key�split�pathr)r
Zkeypath�docr)�_rrr
rszgetitem_property.__init__cCs |jrtdd�|g|j�S|S)NcSs||Srr)�d�krrr
�<lambda>��z(getitem_property._path.<locals>.<lambda>)r)r)r
�objrrr
�_path�s�zgetitem_property._pathcCs|dur|S|�|��|j�Sr)r1�getr')r
r0�typerrr
�__get__�szgetitem_property.__get__cCs||�|�|j<dSr)r1r')r
r0rrrr
�__set__�szgetitem_property.__set__)N)N)rrrrrr1r4r5rrrr
r^s
 

r)NN)r�	functoolsr�__all__rrrrrrrr
�<module>s
 0

Yohohohohohooho | Sanrei Aya