def list_tasks(target=None):
from os import getcwd, chdir<EOL>from glob import glob<EOL>original = getcwd()<EOL>if target is None:<EOL><INDENT>target = _dbdir()<EOL><DEDENT>chdir(target)<EOL>result = {}<EOL>for filename in glob("<STR_LIT>"):<EOL><INDENT>project, task = filename.split('<STR_LIT:.>')[<NUM_LIT:0>:<NUM_LIT:2>]<EOL>if project not in result:<EOL><INDENT>result[project] = []<EOL><DEDENT>result[project].append(task)<EOL><DEDENT>chdir(original)<EOL>return result<EOL>
Returns a list of all the projects and tasks available in the `acorn`
    database directory.

    Args:
        target (str): directory to list the projects for. Defaults to the configured
          database directory.    

    Returns:
        dict: keys are project names; values are lists of tasks associated with the
          project.