<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def group_records_by_category(self):

 """Return the records grouped by the category of their source.
 
 The return value is a dict, a key in this dict is a category
 and the value is a list of all the records with this category.
 
 """

        Source.validate_categories(categories)
        key_function = lambda record: record.source.category
        return self.group_records(key_function)