code: def endLoop(self):
          
          if not self._inLoop:
              raise RuntimeError('run loop not started')
          self.proxy.endLoop(self._driverLoop)
          self._inLoop = False
docs: Stops a running event loop.
  
          @raise RuntimeError: When the loop is not running