code: def get_sorted_hdrgo2usrgos(self, hdrgos, flat_list=None, hdrgo_prt=True, hdrgo_sort=True):
          sorted_hdrgos_usrgos = []
          h2u_get = self.grprobj.hdrgo2usrgos.get
          hdr_go2nt = self._get_go2nt(hdrgos)
          if hdrgo_sort is True:
              hdr_go2nt = sorted(hdr_go2nt.items(), key=lambda t: self.hdrgo_sortby(t[1]))
          for hdrgo_id, hdrgo_nt in hdr_go2nt:
              if flat_list is not None:
                  if hdrgo_prt or hdrgo_id in self.grprobj.usrgos:
                      flat_list.append(hdrgo_nt)
              usrgos_unsorted = h2u_get(hdrgo_id)
              if usrgos_unsorted:
                  usrgo2nt = self._get_go2nt(usrgos_unsorted)
                  usrgont_sorted = sorted(usrgo2nt.items(), key=lambda t: self.usrgo_sortby(t[1]))
                  usrgos_sorted, usrnts_sorted = zip(*usrgont_sorted)
                  if flat_list is not None:
                      flat_list.extend(usrnts_sorted)
                  sorted_hdrgos_usrgos.append((hdrgo_id, usrgos_sorted))
              else:
                  sorted_hdrgos_usrgos.append((hdrgo_id, []))
          return cx.OrderedDict(sorted_hdrgos_usrgos)