<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def setCenter(self, loc):
 """ Move this region so it is centered on ``loc`` """

        offset = self.getCenter().getOffset(loc) # Calculate offset from current center
        return self.setLocation(self.getTopLeft().offset(offset)) # Move top left corner by the same offset