/* CHECK FUNCTIONS
186342
protected function checkPermission($permission, $siteSlug = null)
    {
        if (!$this->Permissions->checkPermission($permission, $siteSlug))
            throw new Exception('Permission denied to action ['.$this->currentActionOrDatasource.']');

        //if(LOG_ENABLE) System::log(self::$logType, 'Passed permission check: ['.$this->currentActionOrDatasource.']');
    }
801436
function check(node) {
            const body = nearestBody(),
                valid = ((body.type === "Program" && body.distance === 1) ||
                    body.distance === 2);

            if (!valid) {
                context.report({
                    node,
                    message: "Move {{type}} declaration to {{body}} root.",
                    data: {
                        type: (node.type === "FunctionDeclaration" ? "function" : "variable"),
                        body: (body.type === "Program" ? "program" : "function body")
                    }
                });
            }
        }
774707
private boolean containsFunctionById(int functionId) {
        if (this instanceof AbstractValueExpression) {
            return false;
        }

        List<AbstractExpression> functionsList = findAllFunctionSubexpressions();
        for (AbstractExpression funcExpr: functionsList) {
            assert(funcExpr instanceof FunctionExpression);
            if (((FunctionExpression)funcExpr).hasFunctionId(functionId)) {
                return true;
            }
        }

        return false;
    }
572736
public function check()
    {
        if (function_exists($this->functionName)) {
            return [EnvironmentCheck::OK, $this->functionName . '() exists'];
        }
        return [EnvironmentCheck::ERROR, $this->functionName . '() doesn\'t exist'];
    }
434643
function all(func) {
        return function() {
            var params = getParams(arguments);
            var length = params.length;
            for (var i = 0; i < length; i++) {
                if (!func.call(null, params[i])) {
                    return false;
                }
            }
            return true;
        };
    }
16886
function checkFileExists(filename, callback) {
  if (fs.exists !== undefined) {
    fs.exists(filename, callback);
  } else {
    fs.stat(filename, function (err) {
      callback(!err);
    });
  }
}
401739
def bool_check(*args, func=None):
    """"""
    func = func or inspect.stack()[2][3]
    for var in args:
        if not isinstance(var, bool):
            name = type(var).__name__
            raise BoolError(
                f'Function {func} expected bool, {name} got instead.')
237232
function checkFunction(node) {
            const parent = node.parent;

            if (parent.type === "CallExpression") {
                callbackStack.push(node);
            }

            if (callbackStack.length > THRESHOLD) {
                const opts = { num: callbackStack.length, max: THRESHOLD };

                context.report({ node, messageId: "exceed", data: opts });
            }
        }
988551
function bindFunctions(functions) {
	var _this = this;

	functions.forEach(function (f) {
		return _this[f] = _this[f].bind(_this);
	});
}
984335
function functionParameters(f) {
  assert(typeof f === 'function');
  var matches = functionRegex.exec(f.toString());
  if(!matches || !matches[2].length) {
    return [];
  }
  return matches[2].split(/[,\s]+/).filter(function(str) {
    return str.length;
  });
}
1114490
function checkFunction(node) {
            if (node.params.length > numParams) {
                context.report({
                    loc: astUtils.getFunctionHeadLoc(node, sourceCode),
                    node,
                    messageId: "exceed",
                    data: {
                        name: lodash.upperFirst(astUtils.getFunctionNameWithKind(node)),
                        count: node.params.length,
                        max: numParams
                    }
                });
            }
        }
1060238
function checkRequiredParameter (param) {
  return (
    typeof param === 'function' || typeof param === 'undefined' || param === '' || param === null || (typeof param === 'number' && isNaN(param))
  );
}
93941
function checkSpacingForFunction(node) {
            const firstToken = node && sourceCode.getFirstToken(node);

            if (firstToken &&
                ((firstToken.type === "Keyword" && firstToken.value === "function") ||
                firstToken.value === "async")
            ) {
                checkSpacingBefore(firstToken);
            }
        }
320148
function check() {
    if (links[currentLink] && currentLink < upTo) {
        this.echo('--- Link ' + currentLink + ' ---');
        start.call(this, links[currentLink]);
        addLinks.call(this, links[currentLink]);
        currentLink++;
        this.run(check);
    } else {
        this.echo("All done.");
        this.exit();
    }
}
902044
private function disabledFunctionCheck()
    {
        $functions = [
            'exec'
        ];
        // Functions needed by symfony process
        foreach($functions as $function){
            if (!function_exists($function)) {
                $this->console->error('Function  "'.$function.'" is required. Is it disabled in php.ini?');
                $this->errors = true;
            }
        }
    }
910972
function checkIfWithoutElse(node) {
            const parent = node.parent;

            /*
             * Fixing this would require splitting one statement into two, so no error should
             * be reported if this node is in a position where only one statement is allowed.
             */
            if (!astUtils.STATEMENT_LIST_PARENTS.has(parent.type)) {
                return;
            }

            const consequents = [];
            let alternate;

            for (let currentNode = node; currentNode.type === "IfStatement"; currentNode = currentNode.alternate) {
                if (!currentNode.alternate) {
                    return;
                }
                consequents.push(currentNode.consequent);
                alternate = currentNode.alternate;
            }

            if (consequents.every(alwaysReturns)) {
                displayReport(alternate);
            }
        }
570862
function checkExpression(node) {
            if (!node.delegate) {
                return;
            }

            const tokens = sourceCode.getFirstTokens(node, 3);
            const yieldToken = tokens[0];
            const starToken = tokens[1];
            const nextToken = tokens[2];

            checkSpacing("before", yieldToken, starToken);
            checkSpacing("after", starToken, nextToken);
        }