
    `f~	                         d Z ddlmZ ddlmZmZmZmZmZ ddl	m
Z
 ddlmZ ddlmZ dZ e
d	           ZddZd Zd
S )zCelery Application.    )_state)app_or_defaultdisable_traceenable_tracepop_current_taskpush_current_task)Proxy   )Celery)
AppPickler)
r   r   r   default_app	bugreportr   r   shared_taskr   r   c                      t           j        S N)r   r        E/var/www/html/env/lib/python3.11/site-packages/celery/app/__init__.py<lambda>r      s	    F. r   Nc                 P    | pt          j                                                    S )z)Return information useful in bug reports.)r   get_current_appr   )apps    r   r   r      s"    +6)++66888r   c                      d }t          |           dk    r,t          | d                   r  |di || d                   S  || i |S )aL  Create shared task (decorator).

    This can be used by library authors to create tasks that'll work
    for any app environment.

    Returns:
        ~celery.local.Proxy: A proxy that always takes the task from the
        current apps task registry.

    Example:

        >>> from celery import Celery, shared_task
        >>> @shared_task
        ... def add(x, y):
        ...     return x + y
        ...
        >>> app1 = Celery(broker='amqp://')
        >>> add.app is app1
        True
        >>> app2 = Celery(broker='redis://')
        >>> add.app is app2
        True
    c                        fd}|S )Nc                                           d          t          j         fd           t          j                    D ]6}|j        r-|j        5   |j         fi  d d d            n# 1 swxY w Y   7 fd}t          |          S )Nnamec                       | j         fi S r   )_task_from_fun)r   funoptionss    r   r   zJshared_task.<locals>.create_shared_task.<locals>.__inner.<locals>.<lambda>7   s    .C.s>>g>> r   c                      t          j                    } | j        p|                     j        j                           S r   )r   r   tasksgen_task_name__name__
__module__)r   r   r   s    r   task_by_conszNshared_task.<locals>.create_shared_task.<locals>.__inner.<locals>.task_by_consB   s<    ,..yKC--clCNKK r   )getr   connect_on_app_finalize_get_active_apps	finalized_finalize_mutexr   r	   )r   r   r&   r   r    s   `  @r   __innerz8shared_task.<locals>.create_shared_task.<locals>.__inner2   s   ;;v&&D *>>>>>  
 .00 ; ;= ;, ; ;**3::':::; ; ; ; ; ; ; ; ; ; ; ; ; ; ;
     
 &&&s   A//A3	6A3	r   )r    r,   s   ` r   create_shared_taskz'shared_task.<locals>.create_shared_task0   s#    	' 	' 	' 	' 	', r   r
   r   r   )lencallable)argskwargsr-   s      r   r   r      sn    0  4 4yyA~~(47++~+!!++F++DG444t.v...r   r   )__doc__celeryr   celery._stater   r   r   r   r   celery.localr	   baser   utilsr   __all__r   r   r   r   r   r   <module>r9      s            j j j j j j j j j j j j j j                   e..//9 9 9 9
4/ 4/ 4/ 4/ 4/r   