def on_leave( self, original_node: CSTNodeT, updated_node: CSTNodeT ) -> Union[cst.Import, cst.ImportFrom, CSTNodeT, RemovalSentinel]: if isinstance(updated_node, cst.Import): for alias in updated_node.names: name = alias.name if isinstance(name, cst.Name) and name.value == "b": return updated_node.remove() elif isinstance(updated_node, cst.ImportFrom): module = updated_node.module if isinstance(module, cst.Name) and module.value == "e": return updated_node.remove() return updated_node
def on_leave(self, original_node: CSTNodeT, updated_node: CSTNodeT) -> Union[CSTNodeT, RemovalSentinel]: if isinstance(updated_node, cst.Continue): return updated_node.remove() else: return updated_node