The inside of ``run``'s infinite loop.

        Separated out so it can be properly unit tested.
969558
def _run(self):
        
        tup = self.read_tuple()
        self._current_tups = [tup]
        if self.is_heartbeat(tup):
            self.send_message({"command": "sync"})
        elif self.is_tick(tup):
            self.process_tick(tup)
            if self.auto_ack:
                self.ack(tup)
        else:
            self.process(tup)
            if self.auto_ack:
                self.ack(tup)
        # Reset _current_tups so that we don't accidentally fail the wrong
        # Tuples if a successive call to read_tuple fails.
        # This is not done in `finally` clause because we want the current
        # Tuples to fail when there is an exception.
        self._current_tups = []
409191
def run(ast)
      ast = [ast] unless ast.is_a?(Array)

      # pre-load all the built-in definitions.
      @constant_loader.run(ast)

      ast.each { |node| iterate(node) }

      freeze
    end
1330373
function run() {
	var len = series.length,
		ctx = context(),
		i = 0;

	series[ i ].call( ctx, next );

	function next() {
		i += 1;
		if ( i < len ) {
			series[ i ].call( ctx, next );
		}
	}
}
1025898
def run(self):
        # type: () -> bool
        
        with util.timed_block() as t:
            files = self._collect_files()

        log.info("Collected <33>{} <32>files in <33>{}s".format(
            len(files), t.elapsed_s
        ))
        if self.verbose:
            for p in files:
                log.info("  <0>{}", p)

        # No files to lint - return success if empty runs are allowed.
        if not files:
            return self.allow_empty

        with util.timed_block() as t:
            results = self._run_checks(files)

        log.info("Code checked in <33>{}s", t.elapsed_s)

        success = True
        for name, retcodes in results.items():
            if any(x != 0 for x in retcodes):
                success = False
                log.err("<35>{} <31>failed with: <33>{}".format(
                    name, retcodes
                ))

        return success
165709
def event_loop(self):
        
        if hasattr(self.loop, '._run_once'):
            self.loop._thread_id = threading.get_ident()
            try:
                self.loop._run_once()
            finally:
                self.loop._thread_id = None
        else:
            self.loop.call_soon(self.loop.stop)
            self.loop.run_forever()
897264
def _try_run(self, run_func: Callable[[], None]) -> None:
        
        # Initialization: before_training
        for hook in self._hooks:
            hook.before_training()

        try:
            run_func()
        except TrainingTerminated as ex:
            logging.info('Training terminated: %s', ex)

        # After training: after_training
        for hook in self._hooks:
            hook.after_training()
1144031
def magic_run(self, line):
        
        i = float('inf')
        if line.strip():
            i = int(line)

        try:
            with warnings.catch_warnings(record=True) as w:
                self.interpreter.run(i)
                for warning_message in w:
                    # TODO should this be stdout or stderr
                    stream_content = {'name': 'stdout', 'text': 'Warning: ' + str(warning_message.message) + '\n'}
                    self.send_response(self.iopub_socket, 'stream', stream_content)
        except iarm.exceptions.EndOfProgram as e:
            f_name = self.interpreter.program[self.interpreter.register['PC'] - 1].__name__
            f_name = f_name[:f_name.find('_')]
            message = "Error in {}: ".format(f_name)
            stream_content = {'name': 'stdout', 'text': message + str(e) + '\n'}
            self.send_response(self.iopub_socket, 'stream', stream_content)
        except Exception as e:
            for err in e.args:
                stream_content = {'name': 'stderr', 'text': str(err)}
                self.send_response(self.iopub_socket, 'stream', stream_content)
            return {'status': 'error',
                    'execution_count': self.execution_count,
                    'ename': type(e).__name__,
                    'evalue': str(e),
                    'traceback': '???'}
770390
def _run(name,
         cmd,
         output=None,
         no_start=False,
         stdin=None,
         python_shell=True,
         preserve_state=False,
         output_loglevel='debug',
         ignore_retcode=False,
         use_vt=False,
         keep_env=None):
    '''
    
    '''
    orig_state = state(name)
    exc = None
    try:
        ret = __salt__['container_resource.run'](
            name,
            cmd,
            container_type=__virtualname__,
            exec_driver=EXEC_DRIVER,
            output=output,
            no_start=no_start,
            stdin=stdin,
            python_shell=python_shell,
            output_loglevel=output_loglevel,
            ignore_retcode=ignore_retcode,
            use_vt=use_vt,
            keep_env=keep_env)
    except Exception:
        raise
    finally:
        # Make sure we stop the container if necessary, even if an exception
        # was raised.
        if preserve_state \
                and orig_state == 'stopped' \
                and state(name) != 'stopped':
            stop(name)

    if output in (None, 'all'):
        return ret
    else:
        return ret[output]
183034
def runner(Options, buffering=True):
    
    def run(argv=None):
        if not buffering:
            sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
            sys.stderr = os.fdopen(sys.stderr.fileno(), 'w', 0)

        if argv is None:
            argv = sys.argv
        o = Options()
        try:
            o.parseOptions(argv[1:])
        except usage.UsageError, e:
            if hasattr(o, 'subOptions'):
                print str(o.subOptions)
            else:
                print str(o)
            print str(e)
            return 1

        return 0

    return run
1360499
def run_in_process
      Open3.popen3(full_command) do |_stdin, stdout, _stderr, waith_thr|
        begin
          loop do
            IO.select([stdout])
            data = stdout.read_nonblock(8)
            logger.write_no_newline(data)
          end
        rescue EOFError # rubocop:disable Lint/HandleExceptions
          # noop
        ensure
          @status = waith_thr.value
        end
      end
    end
1315749
def run(self):
        
        read_stdout = partial(self._read_output, stream=self._process.stdout,
                              callback=self._callback_stdout,
                              output_file=self._stdout_file)

        read_stderr = partial(self._read_output, stream=self._process.stderr,
                              callback=self._callback_stderr,
                              output_file=self._stderr_file)

        # capture the process output as long as the process is active
        try:
            while self._process.poll() is None:
                result_stdout = read_stdout()
                result_stderr = read_stderr()

                if not result_stdout and not result_stderr:
                    sleep(self._refresh_time)

            # read remaining lines
            while read_stdout():
                pass

            while read_stderr():
                pass

        except (StopTask, AbortWorkflow) as exc:
            self._exc_obj = exc
130706
def run_loop(self):
		""
		self.running = True
		event = SDL_Event()
		try:
			while self.running:
				while SDL_PollEvent(ctypes.byref(event)) != 0:
					f = self._sdl_event_handlers.get(event.type)
					if f is not None:
						f ( event )
				self.render_scene()
		except SdlAppQuit as e:
			pass
1219773
def _run(self):
        
        i = 0
        try:
            while i < len(self.program):
                if self.program[i] == ">":
                    self._increment_pointer()
                elif self.program[i] == "<":
                    self._decrement_pointer()
                elif self.program[i] == "+":
                    self._increment_current_byte()
                elif self.program[i] == "-":
                    self._decrement_current_byte()
                elif self.program[i] == ".":
                    self._output_current_byte()
                elif self.program[i] == ",":
                    self._read_byte()
                elif self.program[i] == "[":
                    """
                    if the byte at the data pointer is zero, then instead of moving the instruction pointer forward to
                    the next command, jump it forward to the command after the matching ] command
                    - Wikipedia
                    """
                    if self.tape[self.pointer] is None or self.tape[self.pointer] == 0:
                        loop = 1
                        while loop > 0:
                            i += 1
                            current_instruction = self.program[i]
                            if current_instruction == "]":
                                loop -= 1
                            elif current_instruction == "[":
                                loop += 1
                elif self.program[i] == "]":
                    """
                    if the byte at the data pointer is nonzero, then instead of moving the instruction pointer
                    forward to the next command, jump it back to the command after the matching [ command.
                    - Wikipedia
                    """
                    if self.tape[self.pointer] is not None and self.tape[self.pointer] > 0:
                        loop = 1
                        while loop > 0:
                            i -= 1
                            current_instruction = self.program[i]
                            if current_instruction == "[":
                                loop -= 1
                            elif current_instruction == "]":
                                loop += 1
                i += 1
        except PointerOutOfProgramRange as e:
            print e.message
            sys.exit(1)
        except IndexError as e:
            print "The program went out of bounds of its instructions"
            sys.exit(1)
442864
def run(self):
        
        self.keep_reading = True
        while self.keep_reading:
            line = self._readline()
            if line:
                self.input_queue.appendleft(line)
                Dut.process_dut(self)
890827
@SuppressWarnings("InfiniteLoopStatement")
  @Override
  public void run() {
    try {
      while (true) {
        try {
          cleanUp(queue.remove());
        } catch (InterruptedException e) { /* ignore */ }
      }
    } catch (ShutDown shutDown) { /* ignore */ }
  }
670105
def endLoop(self):
        
        if not self._inLoop:
            raise RuntimeError('run loop not started')
        self.proxy.endLoop(self._driverLoop)
        self._inLoop = False
635653
def run(self, output=None, error=None):
        

        pylint_output = output if output is not None else sys.stdout
        pylint_error = error if error is not None else sys.stderr
        savedout, savederr = sys.__stdout__, sys.__stderr__
        sys.stdout = pylint_output
        sys.stderr = pylint_error

        pylint_files = self.get_files_from_dir(os.curdir)
        self._print_line(
            "Using pylint "
            + colorama.Fore.RED
            + pylint.__version__
            + colorama.Fore.RESET
            + " for python "
            + colorama.Fore.RED
            + PYTHON_VERSION
            + colorama.Fore.RESET
        )

        self._print_line("pylint running on the following files:")
        for pylint_file in pylint_files:
            # we need to recast this as a string, else pylint enters an endless recursion
            split_file = str(pylint_file).split("/")
            split_file[-1] = colorama.Fore.CYAN + split_file[-1] + colorama.Fore.RESET
            pylint_file = "/".join(split_file)
            self._print_line("- " + pylint_file)
        self._print_line("----")

        if not self._is_using_default_rcfile():
            self.args += ["--rcfile={}".format(self.rcfile)]

        exit_kwarg = {"do_exit": False}

        run = pylint.lint.Run(self.args + pylint_files, **exit_kwarg)
        sys.stdout = savedout
        sys.stderr = savederr

        sys.exit(run.linter.msg_status)