Return true if error is suppressed by an inline suppression.
548466
def _error_is_suppressed(error, code, contents):
    """"""
    if len(contents) == 0:
        return False

    if error.line > 1:
        # Check above, and then to the side for suppressions
        above = contents[error.line - 2].split("#")
        if len(above) and _line_suppresses_error_code(above[-1].strip(),
                                                      code):
            return True

    aside = contents[error.line - 1].split("#")
    if len(aside) and _line_suppresses_error_code(aside[-1].strip(), code):
        return True

    return False
1023909
private function suppressErrorReport(bool $suppress = true)
    {
        static $error_reporting;
        static $log_errors;
        if (!isset($error_reporting)) {
            $error_reporting = error_reporting();
            $log_errors      = ini_get('log_errors');
        }

        $reporting = $suppress ? 0 : $error_reporting;
        $logging   = $suppress ? 'off' : $log_errors;
        error_reporting($reporting);
        ini_set('log_errors', $logging);
    }
583532
private function isIncludeJSONThrowOnErrorOption($node): Bool
    {
        if (!$node instanceof Node) {
            return false;
        }

        if ($node->kind === \ast\AST_CONST) {
            $name = $node->children["name"];
            if ($name->kind === \ast\AST_NAME && $name->children["name"] === "JSON_THROW_ON_ERROR") {
                return true;
            }
        }

        if ($node->kind === \ast\AST_BINARY_OP && $node->flags === \ast\flags\BINARY_BITWISE_OR) {
            return $this->isIncludeJSONThrowOnErrorOption($node->children["left"])
                     || $this->isIncludeJSONThrowOnErrorOption($node->children["right"]);
        }

        return false;
    }
176635
def isstrallowed(s,form):
    
    import re
    match = re.match(form,s)
    return match is not None
1025222
public boolean isErrorEnabled()
    {
        if (IS12)
        {
            return getLogger().isEnabledFor(Level.ERROR);
        }
        return getLogger().isEnabledFor(Level.ERROR);
    }
161644
def _has_skip(self, msg):
        '''
        
        '''
        for skip in self.skips:
            if re.search(skip, msg):
                return True
        return False
1331733
public void clearErrors() {

        if ((getAliasError() != null) || (getPathError() != null)) {
            // ensure rows with errors are updated correctly
            m_isChanged = true;
        }
        m_pathError = null;
        m_aliasError = null;
    }
719137
def should_be_excluded(name, exclude_patterns):
    
    for pattern in exclude_patterns:
        if fnmatch.fnmatch(name, pattern):
            return True
    return False
843584
function isMovedError(error) {
  // Check if error message contains something like: "MOVED 14190 127.0.0.1:6379"
  return !!isInstanceOf(error, ReplyError) && error.message && error.message.startsWith('MOVED ');
}
223955
def get_noqa_suppressions(file_contents):
    
    ignore_whole_file = False
    ignore_lines = set()
    for line_number, line in enumerate(file_contents):
        if _FLAKE8_IGNORE_FILE.search(line):
            ignore_whole_file = True
        if _PEP8_IGNORE_LINE.search(line):
            ignore_lines.add(line_number + 1)
    return ignore_whole_file, ignore_lines
101058
private function phpErrorHandler(): Closure
    {
        return static function (int $errno, string $errstr, string $errfile, int $errline): bool {
            // Ignore errors that are silenced with '@'
            if (error_reporting() & $errno) {
                throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
            }

            return true;
        };
    }
158845
static boolean isGeneralError(Symbol amqpError)
	{
		return (amqpError == ClientConstants.SERVER_BUSY_ERROR 
				|| amqpError == ClientConstants.TIMEOUT_ERROR 
				|| amqpError == AmqpErrorCode.ResourceLimitExceeded);
	}
1315469
def on_error(self, ex):
        
        if self._d:
            self._d.errback()
            self._d = None
392851
private boolean havePropogatedError() {
		Request req = getRequest();
		return req != null && req.getAttribute(ACTION_ERROR_KEY) != null;
	}
612937
function popErrorHandling()
    {
        $stack = &$GLOBALS['_PEAR_error_handler_stack'];
        array_pop($stack);
        list($mode, $options) = $stack[sizeof($stack) - 1];
        array_pop($stack);
        if (isset($this) && is_a($this, 'PEAR')) {
            $this->setErrorHandling($mode, $options);
        } else {
            PEAR::setErrorHandling($mode, $options);
        }
        return true;
    }
803947
def should_be_hidden_as_cause(exc):
    
    # reduced traceback in case of HasWrongType (instance_of checks)
    from valid8.validation_lib.types import HasWrongType, IsWrongType
    return isinstance(exc, (HasWrongType, IsWrongType))
1048731
public function hasError(): bool
    {
        return isset($this->decodedBody['error']) || isset($this->decodedBody['errors']) || isset($this->decodedBody['field-errors']);
    }