<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def with_added_dimensions(self, n):
 """ Adds n dimensions and returns the Rect. If n < 0, removes dimensions. """

        if n > 0:
            return Rect(np.pad(self.data, ((0, 0), (0, n)), 'constant'))
        return Rect(self.data[:, :self.dimensions + n])