Run scene.

        Parameters:
            * wait_for_completion: If set, function will return
                after device has reached target position.
499873
async def run(self, wait_for_completion=True):
        
        activate_scene = ActivateScene(
            pyvlx=self.pyvlx,
            wait_for_completion=wait_for_completion,
            scene_id=self.scene_id)
        await activate_scene.do_api_call()
        if not activate_scene.success:
            raise PyVLXException("Unable to activate scene")
582394
def wait(self):
        ''' '''
        self._done_event.wait(MAXINT)
        return self._status, self._exception
634787
def gameloop(self):
        
        try:
            while True:
                self.handle_events()
                self.update()
                self.render()
        except KeyboardInterrupt:
            pass
268757
async def close(self, wait_for_completion=True):
        
        await self.set_position(
            position=Position(position_percent=100),
            wait_for_completion=wait_for_completion)
60441
def runAndWait(self):
        '''
        
        '''
        self._push(self._engine.endLoop, tuple())
        self._driver.startLoop()
1075519
private void waitForMoveCompletion() {
    boolean shouldWait;
    int waitedIterations = 0;
    do {
      shouldWait = false;
      for (BalancerDatanode target : plan.targets) {
        if (!target.isPendingQEmpty()) {
          shouldWait = true;
        }
      }
      if (shouldWait) {
        try {
          if (waitedIterations > MAX_WAIT_ITERATIONS) {
            for (BalancerDatanode target : plan.targets) {
              target.killPending();
            }
            continue;
          }
          waitedIterations++;
          Thread.sleep(blockMoveWaitTime);
        } catch (InterruptedException ignored) {
        }
      }
    } while (shouldWait);
  }
1352280
def _wait_for(self, callback, timeout=None):
        '''
        
        '''
        start = time.time()
        while True:
            if callback():
                return
            elapsed = time.time() - start
            if timeout and elapsed > timeout:
                raise BrowsingTimeout(
                        'timed out after %.1fs waiting for: %s' % (
                            elapsed, callback))
            brozzler.sleep(self._wait_interval)
427715
public void awaitCompletion() throws InterruptedException {
    boolean performedWarning = false;

    while (hasInflightOperations()) {
      synchronized (signal) {
        if (hasInflightOperations()) {
          signal.wait(finishWaitMillis);
        }
      }

      long now = clock.nanoTime();
      if (now >= noSuccessCheckDeadlineNanos) {
        logNoSuccessWarning(now);
        resetNoSuccessWarningDeadline();
        performedWarning = true;
      }
    }
    if (performedWarning) {
      LOG.info("awaitCompletion() completed");
    }
  }
16718
def wait_for_window_focus(self, window, want_focus):
        
        _libxdo.xdo_wait_for_window_focus(self._xdo, window, want_focus)
457390
def wait(self, dwMilliseconds = None):
        
        if self.value is None:
            raise ValueError("Handle is already closed!")
        if dwMilliseconds is None:
            dwMilliseconds = INFINITE
        r = WaitForSingleObject(self.value, dwMilliseconds)
        if r != WAIT_OBJECT_0:
            raise ctypes.WinError(r)
265473
def wait_for_event(event):
    
    f = Future()
    def ready():
        get_event_loop().remove_win32_handle(event)
        f.set_result(None)
    get_event_loop().add_win32_handle(event, ready)
    return f
677484
def wait_for_exists(self, timeout=0, *args, **selectors):
        
        return self.device(**selectors).wait.exists(timeout=timeout)
156692
def waitForEvent(self, tv=0):
        
        if tv is None:
            tv = 0
        tv_s = int(tv)
        real_tv = libusb1.timeval(tv_s, int((tv - tv_s) * 1000000))
        libusb1.libusb_wait_for_event(self.__context_p, byref(real_tv))
704252
def WaitForSnapshotCompleted(snapshot):
  
  print 'Waiting for snapshot %s to be completed...' % (snapshot)
  while True:
      snapshot.update()
      sys.stdout.write('.')
      sys.stdout.flush()
      #print 'status is: %s' % snapshot.status
      if snapshot.status == 'completed':
          break
      time.sleep(5)
  return
951984
def wait(self):
        

        self.log.debug("acquiring wait lock to wait for completion")
        # using the lock in a with-context blocks, which is what we want if
        # we're running wait()
        with self._wait_lock:
            self.log.debug("got wait lock")
            witnessed_end = False

            if self.exit_code is None:
                self.log.debug("exit code not set, waiting on pid")
                pid, exit_code = no_interrupt(os.waitpid, self.pid, 0) # blocks
                self.exit_code = handle_process_exit_code(exit_code)
                witnessed_end = True

            else:
                self.log.debug("exit code already set (%d), no need to wait",
                        self.exit_code)

            self._quit_threads.set()

            # we may not have a thread for stdin, if the pipe has been connected
            # via _piped="direct"
            if self._input_thread:
                self._input_thread.join()

            # wait, then signal to our output thread that the child process is
            # done, and we should have finished reading all the stdout/stderr
            # data that we can by now
            timer = threading.Timer(2.0, self._stop_output_event.set)
            timer.start()

            # wait for our stdout and stderr streamreaders to finish reading and
            # aggregating the process output
            self._output_thread.join()
            timer.cancel()

            self._background_thread.join()

            if witnessed_end:
                self._process_just_ended()

            return self.exit_code
599183
def wait_until(message='completed!')
      3.times { dot_and_sleep(1) }
      begin
        dot_and_sleep(2) until yield
      rescue Excon::Errors::SocketError => e
        # print out the error so the user can interrupt if necessary
        print "#{e.class}: #{e.message}! Retry:"
        sleep(1)
        retry
      end
      puts message
    end
194135
def _trigger(self):
        
        self._completed.set()
        for callback in self._callbacks:
            callback(self)