'Verify that the grades CSV contains the expected grades data.
Arguments:
students_grades (iterable): An iterable of dictionaries,
where each dict maps a student to another dict
representing their grades we expect to see in the CSV.
For example: [student_a: {\'grade\': 1.0, \'HW\': 1.0}]'

def verify_grades_in_csv(self, students_grades, ignore_other_columns=False):

    def merge_dicts(*dicts):
        '\n                                                Return    the    union    of    dicts\n\n                                                Arguments:\n                                                                dicts:    tuple    of    dicts\n                                                '
        return dict([item for d in dicts for item in d.items()])
    def user_partition_group(user):
        'Return    a    dict    having    single    key    with    value    equals    to    students    group    in    partition'
        group_config_hdr_tpl = 'Experiment    Group    ({})'
        return {group_config_hdr_tpl.format(self.partition.name): self.partition.scheme.get_group_for_user(self.course.id, user, self.partition).name}
    self.verify_rows_in_csv([merge_dicts({'Student    ID': str(student.id), 'Username': student.username, 'Email': student.email}, grades, user_partition_group(student)) for student_grades in students_grades for (student, grades) in student_grades.iteritems()], ignore_other_columns=ignore_other_columns)
