Checks if SQL String represents function call

@param decodedSql SQL String which would be checked
@return true/false
329576
public static boolean isFunctionCall(String decodedSql) {
        Pattern regexPattern = null;
        Matcher regexMatcher = null;

        regexPattern = Pattern.compile(REGEX_IS_FUNCTION, Pattern.CASE_INSENSITIVE);
        regexMatcher = regexPattern.matcher(decodedSql);


        return regexMatcher.find();
    }
518353
@SuppressWarnings("unchecked")
    protected boolean executeSQLStmt(final ISelectionProvider _sqlProvider, final String _complStmt)
        throws EFapsException
    {
        SQLRunner.LOG.debug("SQL-Statement: {}", _complStmt);

        boolean ret = false;
        List<Object[]> rows = new ArrayList<>();

        boolean cached = false;
        if (runnable.has(StmtFlag.REQCACHED)) {
            final QueryKey querykey = QueryKey.get(Context.getThreadContext().getRequestId(), _complStmt);
            final Cache<QueryKey, Object> cache = QueryCache.getSqlCache();
            if (cache.containsKey(querykey)) {
                final Object object = cache.get(querykey);
                if (object instanceof List) {
                    rows = (List<Object[]>) object;
                }
                cached = true;
            }
        }
        if (!cached) {
            ConnectionResource con = null;
            try {
                con = Context.getThreadContext().getConnectionResource();
                final Statement stmt = con.createStatement();
                final ResultSet rs = stmt.executeQuery(_complStmt);
                final ArrayListHandler handler = new ArrayListHandler(Context.getDbType().getRowProcessor());
                rows = handler.handle(rs);
                rs.close();
                stmt.close();
            } catch (final SQLException e) {
                throw new EFapsException(SQLRunner.class, "executeOneCompleteStmt", e);
            }
            if (runnable.has(StmtFlag.REQCACHED)) {
                final ICacheDefinition cacheDefinition = new ICacheDefinition() {

                    @Override
                    public long getLifespan()
                    {
                        return 5;
                    }

                    @Override
                    public TimeUnit getLifespanUnit()
                    {
                        return TimeUnit.MINUTES;
                    }
                };
                QueryCache.put(cacheDefinition, QueryKey.get(Context.getThreadContext().getRequestId(), _complStmt), rows);
            }
        }
        for (final Object[] row : rows) {
            for (final Select select : _sqlProvider.getSelection().getAllSelects()) {
                select.addObject(row);
            }
            ret = true;
        }
        return ret;
    }
387092
public static boolean parseReturningKeyword(final char[] query, int offset) {
    if (query.length < (offset + 9)) {
      return false;
    }

    return (query[offset] | 32) == 'r'
        && (query[offset + 1] | 32) == 'e'
        && (query[offset + 2] | 32) == 't'
        && (query[offset + 3] | 32) == 'u'
        && (query[offset + 4] | 32) == 'r'
        && (query[offset + 5] | 32) == 'n'
        && (query[offset + 6] | 32) == 'i'
        && (query[offset + 7] | 32) == 'n'
        && (query[offset + 8] | 32) == 'g';
  }
504134
function isSQLSchema(schemaText) {
	/* A SQL schema should have the word "create" in it but SQL is case insensitive  */
	var create = schemaText.search(/create/i);
	if (create < 0)
		return false;
	var brace = schemaText.indexOf('{');
	if (brace >= 0 && brace < create)
		/* Word create is coincidentally appearing inside what is probably a JSON schema */
		return false;
	/* Looking more like SQL.  Drop any blanks that follow 'create' */
	var balance = schemaText.substring(create + 6).trim();
	/* The next word must be 'table' (case insensitive) */
	var table = balance.search(/table/i);
	return table == 0;
}
215536
static boolean isFollowedOrPrefixedByColon(String sql, int i) {
        return ':' == sql.charAt(i + 1) || (i > 0 && ':' == sql.charAt(i - 1));
    }
1077059
private function isStringDQLQuery($value)
    {
        $keysWord = array(
            "SELECT ",
            " FROM ",
            " WHERE "
        );

        foreach ($keysWord as $keyWord) {
            if (stripos($value, $keyWord) !== false) {
                return true;
            }
        }

        return false;
    }
913479
def decode_sql(self, sql):
        
        # JSON is defined as using "unicode", we'll go a step further and
        # mandate utf-8 (though for the base64 part, it doesn't really matter!)
        base64_sql_bytes = to_unicode(sql).encode('utf-8')
        # in python3.x you can pass `validate=True` to b64decode to get this
        # behavior.
        if not re.match(b'^[A-Za-z0-9+/]*={0,2}$', base64_sql_bytes):
            self.raise_invalid_base64(sql)

        try:
            sql_bytes = base64.b64decode(base64_sql_bytes)
        except ValueError:
            self.raise_invalid_base64(sql)

        return sql_bytes.decode('utf-8')
414437
public void doSql(String funcCall)
  {

    String doSqlFunctionName = "sql_" + funcCall.split("\\s", 2)[0];
    SqlGenerator<QueryData> gen = getGeneratorForQueryFunction(funcCall);
    String annisQuery = getAnnisQueryFromFunctionCall(funcCall);
    QueryData queryData = analyzeQuery(annisQuery, doSqlFunctionName);

    out.println("NOTICE: left = " + left + "; right = " + right + "; limit = "
      + limit + "; offset = " + offset);

    out.println(gen.toSql(queryData));
  }
403997
private function prepareDecodedQueryForUse(&$decoded, &$metaParameters, &$ctypeParameters)
    {
        // If there is only 1 contenttype we assume the where is NOT nested
        if (count($decoded['contenttypes']) == 1) {
            // So we need to add this nesting
            $ctypeParameters = [$decoded['contenttypes'][0] => $ctypeParameters];
        } else {
            // We need to set every non-contenttypeslug parameters to each individual contenttypes
            $globalParameters = [];
            foreach ($ctypeParameters as $key => $parameter) {
                if (!in_array($key, $decoded['contenttypes'])) {
                    $globalParameters[$key] = $parameter;
                }
            }
            foreach ($globalParameters as $key => $parameter) {
                unset($ctypeParameters[$key]);
                foreach ($decoded['contenttypes'] as $contenttype) {
                    if (!isset($ctypeParameters[$contenttype])) {
                        $ctypeParameters[$contenttype] = [];
                    }
                    if (!isset($ctypeParameters[$contenttype][$key])) {
                        $ctypeParameters[$contenttype][$key] = $parameter;
                    }
                }
            }

            // In this case query pagination never makes sense!
            $decoded['self_paginated'] = false;
        }

        if (($decoded['order_callback'] !== false) || ($decoded['return_single'] === true)) {
            // Callback sorting disables pagination
            $decoded['self_paginated'] = false;
        }

        if (!isset($metaParameters['order']) || $metaParameters['order'] === false) {
            if (count($decoded['contenttypes']) == 1) {
                if ($this->getContentTypeGrouping($decoded['contenttypes'][0])) {
                    $decoded['order_callback'] = [$this, 'groupingSort'];
                }
            }
        }

        if ($decoded['return_single']) {
            $metaParameters['limit'] = 1;
        } elseif (!isset($metaParameters['limit'])) {
            $metaParameters['limit'] = 9999;
        }
    }
744838
private static boolean functionMatches(FunctionDescriptor existingFd,
                                           Type returnType,
                                           Type[] parameterTypes) {
        if (returnType != existingFd.m_type) {
            return false;
        }
        if (parameterTypes.length != existingFd.m_paramTypes.length) {
            return false;
        }
        for (int idx = 0; idx < parameterTypes.length; idx++) {
            if (parameterTypes[idx] != existingFd.m_paramTypes[idx]) {
                return false;
            }
        }
        return true;
    }
1064818
function checkQuery(expected, actual){
    if(!expected){
        return;
    }

    //Ignore trailing ampersands
    var actualObj = actual ? queryString.parse(actual.replace(/\&$/, '')) : {};
    var expectedObj = queryString.parse(expected);

    if(! _.isEqual(actualObj, expectedObj)){
        return {
            error: "Query parameters do not match",
            expected: expectedObj,
            actual: actualObj
        };
    }
}
727466
public function isFunctionCall($node, string $function): Bool
    {
        if ($node instanceof Node && $node->kind === \ast\AST_CALL) {
            $expr = $node->children['expr'];

            if ($expr->kind === \ast\AST_NAME && $expr->children['name'] === $function) {
                return true;
            }
        }

        return false;
    }
953333
function isBuiltinFunctionCall (node) {
  return (isLocalCall(node) && builtinFunctions[getLocalCallName(node) + '(' + getFunctionCallTypeParameterType(node) + ')'] === true) || isAbiNamespaceCall(node)
}
962114
function isCallWithFunctionExpression(node) {
  const callObj = isMemberExpression(node.callee) ? node.callee.object : node;
  const firstArg = callObj.arguments ? callObj.arguments[0] : null;
  return callObj !== undefined && isCallExpression(callObj) &&
    firstArg && isFunctionExpression(firstArg);
}
1061228
public boolean isFunctionName( String s ) {
        if( input1.containsKey(s))
            return true;
        if( inputN.containsKey(s))
            return true;

        return false;
    }
864096
public static boolean isSentToMultisig(Script script) {
        List<ScriptChunk> chunks = script.chunks;
        if (chunks.size() < 4) return false;
        ScriptChunk chunk = chunks.get(chunks.size() - 1);
        // Must end in OP_CHECKMULTISIG[VERIFY].
        if (!chunk.isOpCode()) return false;
        if (!(chunk.equalsOpCode(OP_CHECKMULTISIG) || chunk.equalsOpCode(OP_CHECKMULTISIGVERIFY))) return false;
        try {
            // Second to last chunk must be an OP_N opcode and there should be that many data chunks (keys).
            ScriptChunk m = chunks.get(chunks.size() - 2);
            if (!m.isOpCode()) return false;
            int numKeys = decodeFromOpN(m.opcode);
            if (numKeys < 1 || chunks.size() != 3 + numKeys) return false;
            for (int i = 1; i < chunks.size() - 2; i++) {
                if (chunks.get(i).isOpCode()) return false;
            }
            // First chunk must be an OP_N opcode too.
            if (decodeFromOpN(chunks.get(0).opcode) < 1) return false;
        } catch (IllegalStateException e) {
            return false;   // Not an OP_N opcode.
        }
        return true;
    }
1289436
private boolean parseFunction() {
        if (!(curToken instanceof Id) || isELReserved(curToken.toString())) {
            return false;
        }
        String s1 = null; // Function prefix
        String s2 = curToken.toString(); // Function name
        int mark = getIndex();
        if (hasNext()) {
            Token t = nextToken();
            if (t.toChar() == ':') {
                if (hasNext()) {
                    Token t2 = nextToken();
                    if (t2 instanceof Id) {
                        s1 = s2;
                        s2 = t2.toString();
                        if (hasNext()) {
                            t = nextToken();
                        }
                    }
                }
            }
            if (t.toChar() == '(') {
                ELexpr.add(new ELNode.Function(s1, s2));
                return true;
            }
        }
        setIndex(mark);
        return false;
    }