def mk_task_map(task, qualified=True):
    """returns a map of information about the given task function.
    when `qualified` is `False`, the path to the task is truncated to just the task name"""
    path = "%s.%s" % (task.__module__.split('.')[-1], task.__name__)
    unqualified_path = task.__name__
    description = (task.__doc__ or '').strip().replace('\n', ' ')
    return {
        "name": path if qualified else unqualified_path,
        "path": path,
        "description": description,
        "fn": task,
    }