<commit_before>var _ = require('_'),
    overload = require('overload');

// Configure overload to throw type errors
overload.prototype.err = function() {
    throw new TypeError();
};

overload.defineTypes({
    'D': function(obj) {
        return obj && obj instanceof D;
    },
    'nodeList': function(obj) {
        return obj && (obj instanceof NodeList || obj instanceof HTMLCollection);
    },
    'window': function(val) {
        return val && val.window === window;
    },
    'document': function(val) {
        return val && val === document;
    },
    'selector': function(val) {
        return val && (_.isString(val) || _.isFunction(val) || _.isElement(val) || _.isNodeList(val) || _.isArray(val) || val instanceof D);
    }
});

module.exports = overload.O;
<commit_msg>Refactored code<commit_after>var _ = require('_'),
    overload = require('overload');

// Configure overload to throw type errors
overload.prototype.err = function() {
    throw new TypeError();
};

var _isD = function(val) {
    return val instanceof D;
};

var _isArrayLike = function(val) {
    return _isD(val) || _.isArray(val) || _.isNodeList(val);
};

overload.defineTypes({
    'D': function(val) {
        return val && _isD(val);
    },
    'nodeList': function(val) {
        return val && _.isNodeList(val);
    },
    'window': function(val) {
        return val && val.window === window;
    },
    'document': function(val) {
        return val && val === document;
    },
    'selector': function(val) {
        return val && (_.isString(val) || _.isFunction(val) || _.isElement(val) || _isArrayLike(val));
    }
});

module.exports = overload.O;

{'fraction_non_alphanumeric': 0.16888619854721548, 'fraction_numerical': 0.0, 'mean_word_length': 3.021897810218978, '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': '3462998', 'n_tokens_mistral': 516, 'n_tokens_neox': 517, 'n_words': 122}