def flip(self):
left = self.left._replace(red=not self.left.red)<EOL>right = self.right._replace(red=not self.right.red)<EOL>top = self._replace(left=left, right=right, red=not self.red)<EOL>return top<EOL>
Flip colors of a node and its children.