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