human
I wrote the below code

    def group(item):
        return ((item.albumartist or item.artist), item.album)
    task = None
    while True:
        task = (yield task)
        if task.skip:
            continue
        tasks = []
        sorted_items = sorted(task.items, key=group)
        for (_, items) in itertools.groupby(sorted_items, group):
            items = list(items)
            task = ImportTask(task.toppath, [i.path for i in items], items)
            tasks += task.handle_created(session)
        tasks.append(SentinelImportTask(task.toppath, task.paths))
        task = pipeline.multiple(tasks)

What's a good function header?
assistant
#Here's a good function header.

def group_albums(session):