code: def remove_term(self, t):
          
  
          try:
              self.terms.remove(t)
          except ValueError:
              pass
  
          if t.section and t.parent_term_lc == 'root':
              t.section = self.add_section(t.section)
              t.section.remove_term(t, remove_from_doc=False)
  
          if t.parent:
              try:
                  t.parent.remove_child(t)
  
              except ValueError:
                  pass
docs: Only removes top-level terms. Child terms can be removed at the parent.