<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def long_press(self, locator, duration=1000):

 """ Long press the element with optional duration """

        driver = self._current_application()
        element = self._element_find(locator, True, True)
        action = TouchAction(driver)
        action.press(element).wait(duration).release().perform()