Add checker that will be run.
760814
def _add_check(self, node, run, language, is_code_node):
        """"""
        def run_check():
            """Yield errors."""
            all_results = run()
            if all_results is not None:
                if all_results:
                    for result in all_results:
                        error_offset = result[0] - 1

                        line_number = getattr(node, 'line', None)
                        if line_number is not None:
                            yield (
                                beginning_of_code_block(
                                    node=node,
                                    line_number=line_number,
                                    full_contents=self.contents,
                                    is_code_node=is_code_node) +
                                error_offset,
                                '({}) {}'.format(language, result[1]))
                else:
                    yield (self.filename, 0, 'unknown error')
        self.checkers.append(run_check)
975357
public void addCheckBallCommand() {
        StringBuilder buf = new StringBuilder();
        buf.append("(check_ball)");
        fifo.add(fifo.size(), buf.toString());
    }
737470
def check_wrapper(fun):
    ''''''
    @wraps(fun)
    def _wrapper(*args, **kwargs):
        '''Sets the title property of the result of running a checker'''
        title = fun.__name__.replace('_', ' ').capitalize()
        result = fun(*args, **kwargs)
        result.title = title
        return result

    return _wrapper
879715
def get_checker_executable(name):
    """"""
    if programs.is_program_installed(name):
        # Checker is properly installed
        return [name]
    else:
        path1 = programs.python_script_exists(package=None,
                                              module=name+'_script')
        path2 = programs.python_script_exists(package=None, module=name)
        if path1 is not None:  # checker_script.py is available
            # Checker script is available but has not been installed
            # (this may work with pyflakes)
            return [sys.executable, path1]
        elif path2 is not None:  # checker.py is available
            # Checker package is available but its script has not been
            # installed (this works with pycodestyle but not with pyflakes)
            return [sys.executable, path2]
1090597
def run_checked (cmd, ret_ok=(0,), **kwargs):
    """"""
    retcode = run(cmd, **kwargs)
    if retcode not in ret_ok:
        msg = "Command `%s' returned non-zero exit status %d" % (cmd, retcode)
        raise PatoolError(msg)
    return retcode
1101445
def validate(self):
        """"""

        for key, req in self.stored().items():
            val = getattr(self, key)
            req.validate(val)

        # Run checks defined in __checkers__
        self._run_checks()
244533
def check_simple(self, checks, radl):
        """"""

        for f in self.features:
            if not isinstance(f, Feature) or f.prop not in checks:
                continue
            f._check(checks[f.prop], radl)
672630
def run_checked (self):
        """"""
        self.start_time = time.time()
        self.setName("Interrupt")
        while not self.stopped(self.WaitSeconds):
            duration = time.time() - self.start_time
            if duration > self.duration:
                log.warn(LOG_CHECK, "Interrupt after %s" % strformat.strduration_long(duration))
                raise KeyboardInterrupt()
708552
def load_checkers():
    """"""
    for loader, name, _ in pkgutil.iter_modules([os.path.join(__path__[0], 'checkers')]):
        loader.find_module(name).load_module(name)
777070
def input_file(self, filename, lines=None, expected=None, line_offset=0):
        """"""
        if self.options.verbose:
            print('checking %s' % filename)
        fchecker = self.checker_class(
            filename, lines=lines, options=self.options)
        return fchecker.check_all(expected=expected, line_offset=line_offset)
248075
def add_unchecked(self, binsha, mode, name):
        """"""
        self._cache.append((binsha, mode, name))
1284617
def set_checks(self, checks, position=None):
        """"""
        if position is None:
            position = self.position
        self.checkdefs[position][0] = checks
1315064
def append(self, value):
    """"""
    self._values.append(self._type_checker.CheckValue(value))
    if not self._message_listener.dirty:
      self._message_listener.Modified()
796009
def run_program(program, *args):
    """"""
    real_args = [program]
    real_args.extend(args)
    logging.debug(_('check_output arguments: %s'), real_args)
    check_output(real_args, universal_newlines=True)
52870
def check(name, **kwargs):
    
    ctx = Context(**kwargs)
    ctx.execute_action('app:check', **{
        'node': ctx.repo.create_secure_service('node'),
        'name': name,
    })
1193533
def compile(checks):
    """"""

    out = ["import check50"]

    for name, check in checks.items():
        out.append(_compile_check(name, check))

    return "\n\n".join(out)
398701
def add_check(self, check):
    
    if self._add_check_callback is not None:
      if not self._add_check_callback(self, check):
        # rejected, skip!
        return False

    self._checkid2index[check.id] = len(self._checks)
    self._checks.append(check)
    return True