Path 1: 3 calls (0.6)

Control (3)

1def restore_cursor(self) -> Control:
2        """Get control codes to clear the render and restore the cursor to its previous position.
3
4        Returns:
5            Control: A Control instance that may be printed.
6        """
7        if self._shape is not None:
8            _, height = self._shape
9            return Control(
10                ControlType.CARRIAGE_RETURN,
11                *((ControlType.CURSOR_UP, 1), (ControlType.ERASE_IN_LINE, 2)) * height
12            )
13        return Control()
            

Path 2: 2 calls (0.4)

Control (2)

1def restore_cursor(self) -> Control:
2        """Get control codes to clear the render and restore the cursor to its previous position.
3
4        Returns:
5            Control: A Control instance that may be printed.
6        """
7        if self._shape is not None:
8            _, height = self._shape
9            return Control(
10                ControlType.CARRIAGE_RETURN,
11                *((ControlType.CURSOR_UP, 1), (ControlType.ERASE_IN_LINE, 2)) * height
12            )
13        return Control()