def METHOD_NAME(task, task_id, span, is_publish=False):
    """Helper to propagate a `Span` for the given `Task` instance. This
    function uses a `dict` that stores the Span using the
    `(task_id, is_publish)` as a key. This is useful when information must be
    propagated from one Celery signal to another.
    We use (task_id, is_publish) for the key to ensure that publishing a
    task from within another task does not cause any conflicts.
    This mostly happens when either a task fails and a retry policy is in place,
    or when a task is manually retries (e.g. `task.retry()`), we end up trying
    to publish a task with the same id as the task currently running.
    Previously publishing the new task would overwrite the existing `celery.run` span
    in the `dict` causing that span to be forgotten and never finished
    NOTE: We cannot test for this well yet, because we do not run a celery worker,
    and cannot run `task.apply_async()`
    """
    if task is None:
        return
    span_dict = getattr(task, CTX_KEY, None)
    if span_dict is None:
        span_dict = {}
        setattr(task, CTX_KEY, span_dict)
    span_dict[(task_id, is_publish)] = span