<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def summarize_sec2hdrgos(self, sec2d_hdrgos):
 """Get counts of header GO IDs and sections."""

        hdrgos_all = set([])
        hdrgos_grouped = set()
        hdrgos_ungrouped = set()
        sections_grouped = set()
        for sectionname, hdrgos in sec2d_hdrgos:
            self._chk_hdrgoids(hdrgos)
            hdrgos_all.update(hdrgos)
            if sectionname != HdrgosSections.secdflt:
                hdrgos_grouped.update(hdrgos)
                sections_grouped.add(sectionname)
            else:
                hdrgos_ungrouped.update(hdrgos)
        return {'G': hdrgos_grouped,
                'S': sections_grouped,
                'U': hdrgos_all.difference(hdrgos_grouped)}