<commit_before>
function checkArg(type, args, paramIndex) {
    var param = args[paramIndex];
    var paramType = typeof param;
    if (paramType === 'object') {
        if (type.array) {
            return param.every(function(item) {
                return typeof item === type.typeOf;
            });
        }
        return param instanceof type.instance;
    }
    if (paramType === type.typeOf) {
        if (type.varArgs) {
            var varArgs = args.slice(paramIndex, args.length);
            return varArgs.every(function(varArg) {
                return typeof varArg === type.typeOf;
            });
        }
        if (type.enum) {
            return type.enum[param] !== undefined
        }
        return true;
    }
    return false;
}

// checkArgs returns true when there is a matching signature.
function checkArgs(args, signatures) {
    return signatures.some(function(signature) {
        var isVariadic = signature.some(function(param) {
            return param.varArgs;
        });
        if (!isVariadic && signature.length !== args.length) {
            return false;
        }
        return signature.every(function(type, paramIndex) {
            return checkArg(type, args, paramIndex);
        });
    });<commit_msg>missing semicolon<commit_after>
function checkArg(type, args, paramIndex) {
    var param = args[paramIndex];
    var paramType = typeof param;
    if (paramType === 'object') {
        if (type.array) {
            return param.every(function(item) {
                return typeof item === type.typeOf;
            });
        }
        return param instanceof type.instance;
    }
    if (paramType === type.typeOf) {
        if (type.varArgs) {
            var varArgs = args.slice(paramIndex, args.length);
            return varArgs.every(function(varArg) {
                return typeof varArg === type.typeOf;
            });
        }
        if (type.enum) {
            return type.enum[param] !== undefined;
        }
        return true;
    }
    return false;
}

// checkArgs returns true when there is a matching signature.
function checkArgs(args, signatures) {
    return signatures.some(function(signature) {
        var isVariadic = signature.some(function(param) {
            return param.varArgs;
        });
        if (!isVariadic && signature.length !== args.length) {
            return false;
        }
        return signature.every(function(type, paramIndex) {
            return checkArg(type, args, paramIndex);
        });
    });
{'fraction_non_alphanumeric': 0.11393410083366415, 'fraction_numerical': 0.0, 'mean_word_length': 1.930232558139535, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7102863', 'n_tokens_mistral': 683, 'n_tokens_neox': 670, 'n_words': 167}