<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_nts_sorted(self, hdrgo_prt, hdrgos, hdrgo_sort):
 """Return a flat list of grouped and sorted GO terms."""

        nts_flat = []
        self.get_sorted_hdrgo2usrgos(hdrgos, nts_flat, hdrgo_prt, hdrgo_sort)
        return nts_flat