Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def control_pause(self, wait_for_paused=True):
r = self.api_call_with_auth('POST', 'controls/pause')
if r.status_code != 200:
eva_error('control_pause error', r)
elif wait_for_paused:
time.sleep(0.1) # sleep for small period to avoid race condition between updating cache and reading state
self.control_wait_for(RobotState.PAUSED)