docs: def group_records(self, key_function):
          """Return a dict with the records grouped by the key returned by 
          `key_function`.
          
          `key_function` takes a record and returns the value from the record to
          group by (see examples in the group_records_by_* methods below).
          
          The return value is a dict, a key in this dict is a key returned by
          `key_function` and the value is a list of all the records with this key.
          
          """
          sorted_records = sorted(self.records, key=key_function)
          grouped_records = itertools.groupby(sorted_records, key=key_function)
          return dict([(key, list(group)) for key, group in grouped_records])