def projects(args):
    hv = get_harvest()
    if hv:
        people = get_people(hv, args.personids)
        if len(people) > 0:
            times = parse_time_inputs(args.start, args.end)
            start = times[0]
            end = times[1]
            projects = hv.projects()
            projects_by_id = {project.id: project for project in projects}
            print str.format(
                REPORT_HEADER,
                'Projects',
                start.strftime('%Y-%m-%d'),
                end.strftime('%Y-%m-%d'),
            )
            for person in people:
                print str.format(PROJECTS_REPORT_HEADING_FORMAT, person = person)
                person_projects = {}
                for entry in person.entries(start = start, end = end):
                    project = projects_by_id[entry.project_id]
                    if person_projects.has_key(project):
                        person_projects[project] += entry.hours
                    else:
                        person_projects[project] = entry.hours
                for project in person_projects.keys():
                    print str.format(
                        PROJECTS_REPORT_BODY_FORMAT,
                        name = project.name,
                        hours = person_projects[project]
                    )
        else:
            print 'No such person ID(s).'
dataset/ETHPy150Open jakebasile/reap/reap/commands/reports.py/projects/original