Find task lines and corresponding line numbers in a list of lines.

def find_tasks(lines):
    """
    Find task lines and corresponding line numbers in a list of lines.
    """
    tasks = []
    linenumbers = []
    pattern = re.compile(TASK_PATTERN)
    for n, line in enumerate(lines):
        if "#" in line and "<-" in line:
            m = pattern.match(line)
            if m is not None:
                groupdict = m.groupdict()
                linenumbers.append(n)
                for key in groupdict:
                    groupdict[key] = split_task_parameters(groupdict[key])
                    logging.debug(
                        "{0}: {1}".format(key, ", ".join(groupdict[key])))
                tasks.append(groupdict)
    linenumbers.append(len(lines))
    return tasks, linenumbers