def METHOD_NAME(task, task_id, is_publish=False):
    """Helper to retrieve an active `Span` stored in a `Task`
    instance
    """
    span_dict = getattr(task, CTX_KEY, None)
    if span_dict is None:
        return (None, None)
    # See note in `attach_span` for key info
    return span_dict.get((task_id, is_publish), (None, None))