ddtrace/contrib/celery/utils.py
def attach_span(task, task_id, span):
    """Helper to propagate a `Span` for the given `Task` instance. This
    function uses a `WeakValueDictionary` that stores a Datadog Span using
    the `task_id` as a key. This is useful when information must be
    propagated from one Celery signal to another.
    """
    weak_dict = getattr(task, CTX_KEY, None)
    if weak_dict is None:
        weak_dict = WeakValueDictionary()
        setattr(task, CTX_KEY, weak_dict)

    weak_dict[task_id] = span
Helper to propagate a `Span` for the given `Task` instance. This
    function uses a `WeakValueDictionary` that stores a Datadog Span using
    the `task_id` as a key. This is useful when information must be
    propagated from one Celery signal to another.
    
Helper to propagate a `Span` for the given `Task` instance. This
function uses a `WeakValueDictionary` that stores a Datadog Span using
the `task_id` as a key. This is useful when information must be
propagated from one Celery signal to another.
Helper to propagate a ` Span ` for the given ` Task ` instance . This function uses a ` WeakValueDictionary ` that stores a Datadog Span using the ` task_id ` as a key . This is useful when information must be propagated from one Celery signal to another .
def attach_span(task, task_id, span):
    weak_dict = getattr(task, CTX_KEY, None)
    if weak_dict is None:
        weak_dict = WeakValueDictionary()
        setattr(task, CTX_KEY, weak_dict)
    weak_dict[task_id] = span
def attach_span ( task , task_id , span ) : weak_dict = getattr ( task , CTX_KEY , None ) if weak_dict is None : weak_dict = WeakValueDictionary ( ) setattr ( task , CTX_KEY , weak_dict ) weak_dict [ task_id ] = span
Helper to propagate a `Span` for the given `Task` instance.
Helper to propagate a ` Span ` for the given ` Task ` instance .
"""Helper to propagate a `Span` for the given `Task` instance. This
    function uses a `WeakValueDictionary` that stores a Datadog Span using
    the `task_id` as a key. This is useful when information must be
    propagated from one Celery signal to another.
    """
task
task_id
span