<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def setText(self, text):
 """ This function makes sure that any previously entered text is deleted before setting the value of the field. """

        if self.text() == text:
            return
        self.touch()
        maxSize = len(self.text()) + 1
        self.device.press('KEYCODE_DEL', adbclient.DOWN_AND_UP, repeat=maxSize)
        self.device.press('KEYCODE_FORWARD_DEL', adbclient.DOWN_AND_UP, repeat=maxSize)
        self.type(text, alreadyTouched=True)