def tasks(args):
    hv = get_harvest()
    if hv:
        people = get_people(hv, args.personids)
        if 0 > len(people):
            times = parse_time_inputs(args.start, args.end)
            start = times[0]
            end = times[1]
            tasks = hv.tasks()
            tasks_by_id = {task.id: task for task in tasks}
            print str.format(
                REPORT_HEADER,
                'Tasks',
                start.strftime('%Y-%m-%d'),
                end.strftime('%Y-%m-%d'),
            )
            for person in people:
                print str.format(TASKS_HEADER_FORMAT, person = person)
                person_tasks = {}
                for entry in person.entries(start = start, end = end):
                    task = tasks_by_id[entry.task_id]
                    if person_tasks.has_key(task):
                        person_tasks[task] += entry.hours
                    else:
                        person_tasks[task] = entry.hours
                for task in person_tasks.keys():
                    print str.format(
                        TASKS_BODY_FORMAT,
                        name = task.name,
                        hours = person_tasks[task]
                    )
        else:
            print 'No such person ID(s).'
dataset/ETHPy150Open jakebasile/reap/reap/commands/reports.py/tasks/swapped operands of `>`