code: def sort_by_term(self, order=None):
          
  
          if order is None:
              self.terms = sorted(self.terms, key=lambda e: e.join_lc)
          else:
  
              all_terms = list(self.terms)
              sorted_terms = []
  
              for tn in order:
                  for t in list(all_terms):
  
                      if t.term_is(tn):
                          all_terms.remove(t)
                          sorted_terms.append(t)
  
              sorted_terms.extend(sorted(all_terms, key=lambda e: e.join_lc))
  
              self.terms = sorted_terms
docs: Sort the terms in the section.
          :param order: If specified, a list of qualified, lowercased term names. These names will appear
          first in the section, and the remaining terms will be sorted alphabetically. If not specified, all terms are
          alphabetized.
          :return: