pydocstyle code checking.

        :return list: List of errors.
502635
def run(path, code=None, params=None, **meta):
        
        if 'ignore_decorators' in params:
            ignore_decorators = params['ignore_decorators']
        else:
            ignore_decorators = None
        check_source_args = (code, path, ignore_decorators) if THIRD_ARG else (code, path)
        return [{
            'lnum': e.line,
            # Remove colon after error code ("D403: ..." => "D403 ...").
            'text': (e.message[0:4] + e.message[5:]
                     if e.message[4] == ':' else e.message),
            'type': 'D',
            'number': e.code
        } for e in PyDocChecker().check_source(*check_source_args)]
8196
def get_field_errors(self, field):
        
        identifier = format_html('{0}[\'{1}\']', self.form_name, field.name)
        errors = self.errors.get(field.html_name, [])
        return self.error_class([SafeTuple(
            (identifier, self.field_error_css_classes, '$pristine', '$pristine', 'invalid', e)) for e in errors])
22862
def call_and_catch_errors(self, f, *args, **kwargs):
        
        try:
            return f(*args, **kwargs)
        except SassError as e:
            if self.live_errors:
                # TODO should this setting also capture and display warnings?
                return e.to_css()
            else:
                raise
964722
def checkForSpiceError(f):
    
    if failed():
        errorparts = {
            "tkvsn": tkvrsn("TOOLKIT").replace("CSPICE_", ""),
            "short": getmsg("SHORT", 26),
            "explain": getmsg("EXPLAIN", 100).strip(),
            "long": getmsg("LONG", 321).strip(),
            "traceback": qcktrc(200)}
        msg = stypes.errorformat.format(**errorparts)
        reset()
        raise stypes.SpiceyError(msg)
1275249
def add_codes(err_cls):
    """"""
    class ErrorsWithCodes(object):
        def __getattribute__(self, code):
            msg = getattr(err_cls, code)
            return '[{code}] {msg}'.format(code=code, msg=msg)
    return ErrorsWithCodes()
671815
def check_settings(self, settings):
        
        assert isinstance(settings, dict)

        errors = []
        if not isinstance(settings, dict) or len(settings) == 0:
            errors.append('invalid_syntax')
        else:
            if not self.__sp_validation_only:
                errors += self.check_idp_settings(settings)
            sp_errors = self.check_sp_settings(settings)
            errors += sp_errors

        return errors
462000
def check(cls):
        
        if cls == AppSettings:
            return None

        exceptions = []
        for setting in cls.settings.values():
            try:
                setting.check()
            # pylama:ignore=W0703
            except Exception as e:
                exceptions.append(str(e))
        if exceptions:
            raise ImproperlyConfigured("\n".join(exceptions))
256830
def errors_string(self):
        
        output = []
        for e in self.errors:
            output.append('%s: %s in %s:' % (e[1], e[2], e[0]))
            output.append(''.join(traceback.format_tb(e[3])))
        return '\n'.join(output)
409012
def check(module):
  global passed, failed
  '''
  
  '''
  module_name = module.rsplit('/', 1)[1]
  if module[-3:] == ".py" and module_name not in IGNORED_FILES:
    print ("CHECKING ", module)
    pout = os.popen('pylint %s'% module, 'r')
    for line in pout:
      if "Your code has been rated at" in line:
        print ("PASSED pylint inspection: " + line)
        passed += 1
        return True
      if "-error" in line:
        print ("FAILED pylint inspection: " + line)
        failed += 1
        errors.append("FILE: " + module)
        errors.append("FAILED pylint inspection: " + line)
        return False
35739
def get_all_code_styles():
    
    result = dict((name, style_from_pygments_cls(get_style_by_name(name))) for name in get_all_styles())
    result['win32'] = Style.from_dict(win32_code_style)
    return result
21363
def _validate(self):
        

        v_mod = utils.import_string('.'.join([
            'pyswagger',
            'scanner',
            'v' + self.version.replace('.', '_'),
            'validate'
        ]))

        if not v_mod:
            # there is no validation module
            # for this version of spec
            return []

        s = Scanner(self)
        v = v_mod.Validate()

        s.scan(route=[v], root=self.__raw)
        return v.errs
528263
def spec_check(self, auth_list, fun, args, form):
        '''
        
        '''
        if not auth_list:
            return False
        if form != 'cloud':
            comps = fun.split('.')
            if len(comps) != 2:
                # Hint at a syntax error when command is passed improperly,
                # rather than returning an authentication error of some kind.
                # See Issue #21969 for more information.
                return {'error': {'name': 'SaltInvocationError',
                                  'message': 'A command invocation error occurred: Check syntax.'}}
            mod_name = comps[0]
            fun_name = comps[1]
        else:
            fun_name = mod_name = fun
        for ind in auth_list:
            if isinstance(ind, six.string_types):
                if ind[0] == '@':
                    if ind[1:] == mod_name or ind[1:] == form or ind == '@{0}s'.format(form):
                        return True
            elif isinstance(ind, dict):
                if len(ind) != 1:
                    continue
                valid = next(six.iterkeys(ind))
                if valid[0] == '@':
                    if valid[1:] == mod_name:
                        if self.__fun_check(ind[valid], fun_name, args.get('arg'), args.get('kwarg')):
                            return True
                    if valid[1:] == form or valid == '@{0}s'.format(form):
                        if self.__fun_check(ind[valid], fun, args.get('arg'), args.get('kwarg')):
                            return True
        return False
749867
def throws_errors(func):
    
    @wraps(func)
    def wrapper(*args, **kwargs):
        response = func(*args, **kwargs)

        # if no status code is provided, assume 400
        if isinstance(response, BugZooException):
            err_jsn = flask.jsonify(response.to_dict())
            return err_jsn, 400

        if isinstance(response, tuple) \
           and isinstance(response[0], BugZooException):
            err = response[0] # type: BugZooException
            err_jsn = flask.jsonify(err.to_dict())
            return (err_jsn, *response[1:])

        return response

    return wrapper
1049135
def check(cls):
        
        attribs = [
            'app_version',
            'app_name',
            'config_file_path',
            'config_sep_str',
        ]
        for attrib in attribs:
            if getattr(cls, attrib) == 'not_set':
                raise IncompleteSetupError(f'elib_config setup is incomplete; missing: {attrib}')
622681
def get_object_errors(self):
        
        if self._object_errors is None:
            self._object_errors = [{str(o): o.get_errors()}
                                   for o in self.objects()
                                   if o.has_error()]

        return self._object_errors
1256061
def _get_errors(self):
        
        errors = self.json.get('data').get('failures')
        if errors:
            logger.error(errors)
        return errors
1352918
def check_error(when='periodic check'):
    

    errors = []
    while True:
        err = glGetError()
        if err == GL_NO_ERROR or (errors and err == errors[-1]):
            break
        errors.append(err)
    if errors:
        msg = ', '.join([repr(ENUM_MAP.get(e, e)) for e in errors])
        err = RuntimeError('OpenGL got errors (%s): %s' % (when, msg))
        err.errors = errors
        err.err = errors[-1]  # pyopengl compat
        raise err