def swap(self, c1: Window, c2: Window, focus: int = 1) -> None:
        """
        Swap the two given clients in list.
        The optional argument 'focus' can be 1 or 2.
        In case of 1, the first client c1 is focused, in case of 2 the c2 and
        the current_index is not changed otherwise.
        """
        i1 = self.clients.index(c1)
        i2 = self.clients.index(c2)
        self.clients[i1], self.clients[i2] = self.clients[i2], self.clients[i1]
        if focus == 1:
            self.current_index = i1
        elif focus == 2:
            self.current_index = i2

        Swap the two given clients in list.
        The optional argument 'focus' can be 1 or 2.
        In case of 1, the first client c1 is focused, in case of 2 the c2 and
        the current_index is not changed otherwise.
        
libqtile/layout/base.py