(node)
Isolate node from its children and parents by breaking those links.
Isolate node from its children and parents by breaking those links.
Isolate node from its children and parents by breaking those links .
def isolate_node(node):
  """Isolate node from its children and parents by breaking those links."""
  for p in node.parents:
    p.children.remove(node)
  for c in node.children:
    c.parents.remove(node)
  node.children = []
  node.parents = []
def isolate_node ( node ) : for p in node . parents : p . children . remove ( node ) for c in node . children : c . parents . remove ( node ) node . children = [ ] node . parents = [ ]