Return function for sorting.

def sortby(self, ntd):
        """Return function for sorting."""
        if 'reldepth' in self.grprobj.gosubdag.prt_attr['flds']:
            return [ntd.NS, -1*ntd.dcnt, ntd.reldepth]
        else:
            return [ntd.NS, -1*ntd.dcnt, ntd.depth]