def event_reverse(event_time, event_schedule, indent_level = 0): print(('\t' * indent_level) + event_time.strftime('%%d:%M %p').lower() % (event_time.hour % 12)) rev_a = {} for assignment in event_schedule: for person in hookline.flatten_list(event_schedule[assignment]): if person not in rev_a: rev_a[person] = [] rev_a[person].append(assignment) for person in sorted(rev_a): print('\t\t%s: %s' % (person, ', '.join(rev_a[person])))
def has_names(assignment_tuple): return len(hookline.flatten_list(assignment_tuple[1])) > 0