rubocop:disable Lint/HandleExceptions
 Yield all events since the last call
548145
def each_new_event
      new_events = []
      stack.events.each do |event|
        break if event.id == @last_processed_event_id
        new_events.unshift(event)
      end
      new_events.each do |event|
        yield event
        @last_processed_event_id = event.id
      end
    rescue Aws::CloudFormation::Errors::ValidationError => _e
    end
1189603
function lint() {
  var errorsFound = false;
  var stream = gulp.src(config.lintGlobs);

  if (isWatching) {
    stream = stream.pipe(watcher());
  }

  if (argv.fix) {
    options.fix = true;
  }

  return stream.pipe(eslint(options))
    .pipe(eslint.formatEach('stylish', function(msg) {
      errorsFound = true;
      util.log(util.colors.red(msg));
    }))
    .pipe(gulpIf(isFixed, gulp.dest('.')))
    .pipe(eslint.failAfterError())
    .on('end', function() {
      if (errorsFound && !options.fix) {
        util.log(util.colors.blue('Run `gulp lint --fix` to automatically ' +
            'fix some of these lint warnings/errors. This is a destructive ' +
            'operation (operates on the file system) so please make sure ' +
            'you commit before running.'));
      }
    });
}
1103663
def connection_event(event, *args)
    return unless @connection_event_handlers.keys.include?(event)
    @connection_event_handlers[event].each { |h| h.call(self, *args) }
  end
1226032
function _dispatch(events, data) {
    var i,
        j,
        i_end,
        j_end,
        event,
        eventName,
        eArray = Array.isArray(events) ?
                   events :
                   events.split(/ /);

    data = data === undefined ? {} : data;

    for (i = 0, i_end = eArray.length; i !== i_end; i += 1) {
      eventName = eArray[i];

      if (_handlers[eventName]) {
        event = {
          type: eventName,
          data: data || {}
        };

        for (j = 0, j_end = _handlers[eventName].length; j !== j_end; j += 1)
          try {
            _handlers[eventName][j].handler(event);
          } catch (e) {}
      }
    }
  }
187636
function lint () {
  console.log(
    chalk.gray('Running linting…\n')
  )

  // Run all linters
  const results = [
    dockerLinter,
    templateLinter,
    javascriptLinter,
    markdownLinter,
    sassLinter
  ]
    .map((Linter) => {
      const linter = new Linter()
      return linter.lint()
    })

  console.log(
    chalk.gray('\nlinting complete!')
  )

  const erred = results.indexOf(true) !== -1

  // If file was called via CLI and there are errors exit process with failed status
  if (require.main === module && erred) {
    process.exit(1)
  }

  return erred
}
218555
def each
      loop do
        results.each do |result|
          yield(result)
        end
        go_next!
      end
    rescue UserEngage::NoNextPageAvailableException
      true
    end
996448
def submit_and_wait
      raise ArgumentError, "#{self.class}#dev_handle not set" unless @dev_handle

      @completion_flag.completed = false
      submit! do |tr2|
        @completion_flag.completed = true
      end

      until @completion_flag.completed?
        begin
          @dev_handle.device.context.handle_events nil, @completion_flag
        rescue ERROR_INTERRUPTED
          next
        rescue LIBUSB::Error
          cancel!
          until @completion_flag.completed?
            @dev_handle.device.context.handle_events nil, @completion_flag
          end
          raise
        end
      end
    end
704348
def each_run(file)
      if file
        file = File.new(file)
        matrix = YAML.load(ERB.new(file.read).result)
        file.close

        matrix.each_with_index do |run, i|
          DEFAULT_RUN.merge(run)
          yield(run, i)
        end
      else
        yield(DEFAULT_RUN)
      end
    end
1112658
function(lir) {
      var createChildEvent = undefined;
      lir.renderMainThread.iterateAllEvents(function(event) {
        if (event.title !== CREATE_CHILD_TITLE)
          return;

        if (event.args.child !== lir.routingId)
          return;

        createChildEvent = event;
      });

      if (!createChildEvent)
        return undefined;

      return createChildEvent.args.id;
    }
710871
def lint(plugin)
      hooks = before_hooks(plugin) + around_hooks(plugin) + after_hooks(plugin)

      hooks.each do |hook|
        if hook.to_s.end_with?("perform")
          raise LintError, "#{plugin}.#{hook} is not namespaced"
        end
      end

      failure_hooks(plugin).each do |hook|
        if hook.to_s.end_with?("failure")
          raise LintError, "#{plugin}.#{hook} is not namespaced"
        end
      end
    end
1036441
def lint(commit = nil)
      files = pronto(commit)
      return if files.empty?

      markdown offenses_message(files)
    end
1142992
def run
      raise NoEngineException, "No JS engine available" unless js_engine
      Utils.log "Running JSHint via #{js_engine.name}:\n\n"

      errors = @file_list.map { |file| process_file(file) }.flatten

      if errors.length == 0
        Utils.log "\nNo JS errors found."
      else
        Utils.log "\nFound #{Utils.pluralize(errors.length, 'error')}."
        raise LintCheckFailure, "JSHint test failed."
      end
    end
987843
def dispatch_events!
      loop do
        event = @event_queue.pop

        callbacks.each do |callback|
          Thread.new do
            callback.call event
          end
        end
      end
    end
583888
def run_on_change(paths)
      if @options[:dry_run]
        paths.each { |path| UI.info "Dry run: #{path}" }
        return
      end

      total    = 0
      failures = 0
      duration = 0
      run_command("mix test #{paths.join(' ')}") do |line|
        puts line
        if /Finished in ([0-9.]+) seconds/.match(line)
          duration = Regexp::last_match[1]
        elsif /([0-9]+) tests, ([0-9]+) failures/.match(line)
          total = Regexp::last_match[1].to_i
          failures = Regexp::last_match[2].to_i
        end
      end

      Notifier.notify(
        guard_message(total, failures, duration),
        :title => "Elixir results",
        :image => guard_image(failures),
        :priority => guard_priority(failures)
      )
    end
1103316
function(name) {
        var self = this, found = false;
        if (!name) { return found; }
        utils.each(this._handlers, function(i) {
            if (name === this.name) {
                self._handlers.splice(i, 1);
                return (found = true, false);
            }
        });
        if (!found) {
            utils.each(this._lastHandlers, function(i) {
                if (name === this.name) {
                    self._lastHandlers.splice(i, 1);
                    return (found = true, false);
                }
            });
        }
        return found;
    }
8022
def scan_for_lints(options)
      reporter = reporter_from_options(options)
      report = Runner.new.run(options.merge(reporter: reporter))
      report.display
      report.failed? ? Sysexits::EX_DATAERR : Sysexits::EX_OK
    end
354963
def detect_valid_handler(servers)
      handler = nil
      while (server_name = servers.shift) && handler.nil?
        begin
          handler = ::Rack::Handler.get(server_name)
          return [handler, server_name]
        rescue LoadError
          handler = nil
        rescue NameError
          handler = nil
        end
      end
    end