def get_task_tree(white_list=None):
assert white_list is None or isinstance(white_list, list), type(white_list)<EOL>if white_list is not None:<EOL><INDENT>white_list = set(item if isinstance(item, str) else item.__qualname__ for item in white_list)<EOL><DEDENT>tree = dict((task.qualified_name, task)<EOL>for task<EOL>in _task_list.values()<EOL>if white_list is None or task.qualified_name in white_list)<EOL>plugins = get_plugin_list()<EOL>for plugin in [plugin for plugin in plugins.values() if white_list is None or plugin.__qualname__ in white_list]:<EOL><INDENT>tasks = [func<EOL>for _, func<EOL>in inspect.getmembers(plugin)<EOL>if inspect.isfunction(func) and hasattr(func, "<STR_LIT>")]<EOL>if len(tasks) == <NUM_LIT:0>:<EOL><INDENT>continue<EOL><DEDENT>node = tree<EOL>for name in plugin.__qualname__.split("<STR_LIT:.>"):<EOL><INDENT>if not name in node:<EOL><INDENT>node[name] = {}<EOL><DEDENT>node = node[name]<EOL><DEDENT>for func in tasks:<EOL><INDENT>logger.debug("<STR_LIT>", func)<EOL>node[func.__name__] = Task(plugin_class=plugin, func=func, config=func.yaz_task_config)<EOL><DEDENT><DEDENT>return tree<EOL>
Returns a tree of Task instances

    The tree is comprised of dictionaries containing strings for
    keys and either dictionaries or Task instances for values.

    When WHITE_LIST is given, only the tasks and plugins in this
    list will become part of the task tree.  The WHITE_LIST may
    contain either strings, corresponding to the task of plugin
    __qualname__, or, preferable, the WHITE_LIST contains
    links to the task function or plugin class instead.