code: def avl_release_parent(node):
      
      parent = node.parent
      if parent is not None:
          if parent.right is node:
              parent.right = None
          elif parent.left is node:
              parent.left = None
          else:
              raise AssertionError('impossible state')
          node.parent = None
          parent.balance = max(height(parent.right), height(parent.left)) + 1
      return node, parent
docs: removes the parent of a child