<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def window(self, windowNum=0):
 """ Returns the region corresponding to the specified window of the app. Defaults to the first window found for the corresponding PID. """

        if self._pid == -1:
            return None
        x,y,w,h = PlatformManager.getWindowRect(PlatformManager.getWindowByPID(self._pid, windowNum))
        return Region(x,y,w,h).clipRegionToScreen()