def move_window(self, window, new_index):
assert isinstance(window, Window)<EOL>assert isinstance(new_index, int)<EOL>window.index = new_index<EOL>self.windows = sorted(self.windows, key=lambda w: w.index)<EOL>
Move window to a new index.