code: def groupby_field(records, field_name, skip_none=True):
      
      return apply_groupby(
          records,
          lambda obj: getattr(obj, field_name),
          skip_none=skip_none)
docs: Given a list of objects, group them into a dictionary by
      the unique values of a given field name.