def METHOD_NAME(task: asyncio.Task) -> TaskInfoDict:
    def _format_frame(f):
        return StackInfoDict(f_code=f.f_code, f_lineno=f.f_lineno)
    info = TaskInfoDict(
        txt=str(task),
        type=str(type(task)),
        done=task.done(),
        cancelled=False,
        stack=[],
        exception=None,
    )
    if not task.done():
        info["stack"] = [_format_frame(x) for x in task.get_stack()]
    elif task.cancelled():
        info["cancelled"] = True
    else:
        # WARNING: raise if not done or cancelled
        exc = task.exception()
        info["exception"] = f"{type(exc)}: {exc!s}" if exc else None
    return info