<commit_before>(function(tree) {

tree.ZoomFilter = function(key, op, val, index) {
    this.key = key;
    this.op = op;
    this.val = parseInt(val);
    this.index = index;
    this.zoom_range = this.create_range(this.op.value, this.val);
};

/**
 * Create an array of true, false values
 * which denotes whether this filter should apply
 * to each of the zoom levels from 0-22.
 */
tree.ZoomFilter.prototype.create_range = function(op, value) {
    var max_zoom = 22;
    var zoom_range = [];
    if (op === '>' || op === '>=') {
        if (op === '>') val++;
        for (var i = 0; i < max_zoom; i++) {
            zoom_range[i] = (i >= val);
        }
    } else {
        if (op === '<') val--;
        for (var i = 0; i < max_zoom; i++) {
            zoom_range[i] = (i <= val);
        }
    }
    return zoom_range;
};

/**
 * Find the overlap of this and another set
 */
tree.ZoomFilter.prototype.intersection = function(filter) {
    if (filter.zoom_range) {
        for (var i = 0; i < this.max_zoom; i++) {
            this.zoom_range[i] = this.zoom_range[i] && filter.zoom_range[i];
        }
    }
};

/**
 * Find the union of this and another set
 */
tree.ZoomFilter.prototype.union = function(filter) {
    if (filter.zoom_range) {
        for (var i = 0; i < this.max_zoom; i++) {
            this.zoom_range[i] = this.zoom_range[i] || filter.zoom_range[i];
        }
    }
};

/**
 * Invert this style rule. Apply to all zoom levels
 * that the rule previously did not apply to and
 * vice versa.
 *
 * Usage is for doing the equivalent of an ElseFilter
 * for defaulting to non-zoom-filtered rules
 */
tree.ZoomFilter.prototype.inverse = function() {
    for (var i = 0; i < this.max_zoom; i++) {
        this.zoom_range[i] = !this.zoom_range[i];
    }
};

tree.ZoomFilter.prototype.toCSS = function(env) {
    if (this.val > 22 || this.val < 0) {
        throw {
            message: 'Only zoom levels between 0 and 22 supported.',
            index: this.index
        }
    }

    var zooms = {
      '1': [200000000, 500000000],
      '2': [100000000, 200000000],
      '3': [50000000, 100000000],
      '4': [25000000, 50000000],
      '5': [12500000, 25000000],
      '6': [6500000, 12500000],
      '7': [3000000, 6500000],
      '8': [1500000, 3000000],
      '9': [750000, 1500000],
     '10': [400000, 750000],
     '11': [200000, 400000],
     '12': [100000, 200000],
     '13': [50000, 100000],
     '14': [25000, 50000],
     '15': [12500, 25000],
     '16': [5000, 12500],
     '17': [2500, 5000],<commit_msg>Making zoomfilter work with negate<commit_after>(function(tree) {

tree.ZoomFilter = function(key, op, val, index) {
    this.key = key;
    this.op = op;
    this.val = parseInt(val);
    this.index = index;
    this.zoom_range = this.create_range(this.op.value, this.val);
};

/**
 * Create an array of true, false values
 * which denotes whether this filter should apply
 * to each of the zoom levels from 0-22.
 */
tree.ZoomFilter.prototype.create_range = function(op, value) {
    var max_zoom = 22;
    var zoom_range = [];
    if (op === '>' || op === '>=') {
        if (op === '>') val++;
        for (var i = 0; i < max_zoom; i++) {
            zoom_range[i] = (i >= val);
        }
    } else {
        if (op === '<') val--;
        for (var i = 0; i < max_zoom; i++) {
            zoom_range[i] = (i <= val);
        }
    }
    return zoom_range;
};

/**
 * Find the overlap of this and another set
 */
tree.ZoomFilter.prototype.intersection = function(filter) {
    if (filter.zoom_range) {
        for (var i = 0; i < this.max_zoom; i++) {
            this.zoom_range[i] = this.zoom_range[i] && filter.zoom_range[i];
        }
    }
};

/**
 * Find the union of this and another set
 */
tree.ZoomFilter.prototype.union = function(filter) {
    if (filter.zoom_range) {
        for (var i = 0; i < this.max_zoom; i++) {
            this.zoom_range[i] = this.zoom_range[i] || filter.zoom_range[i];
        }
    }
};

/**
 * Invert this style rule. Apply to all zoom levels
 * that the rule previously did not apply to and
 * vice versa.
 *
 * Usage is for doing the equivalent of an ElseFilter
 * for defaulting to non-zoom-filtered rules
 */
tree.ZoomFilter.prototype.negate = function() {
    this.zoom_range = this.zoom_range.map(function(i) {
        return !i;
    });
    return this;
};

tree.ZoomFilter.prototype.toCSS = function(env) {
    if (this.val > 22 || this.val < 0) {
        throw {
            message: 'Only zoom levels between 0 and 22 supported.',
            index: this.index
        };
    }

    var zooms = {
      '1': [200000000, 500000000],
      '2': [100000000, 200000000],
      '3': [50000000, 100000000],
      '4': [25000000, 50000000],
      '5': [12500000, 25000000],
      '6': [6500000, 12500000],
      '7': [3000000, 6500000],
      '8': [1500000, 3000000],
      '9': [750000, 1500000],
     '10': [400000, 750000],
     '11': [200000, 400000],
     '12': [100000, 200000],
     '13': [50000, 100000],
     '14': [25000, 50000],
     '15': [12500, 25000],
     '16': [5000, 12500],
     '17': [2500, 5000],
{'fraction_non_alphanumeric': 0.16611230678927802, 'fraction_numerical': 0.10389356290354138, 'mean_word_length': 2.315175097276265, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 14, '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': '2855690', 'n_tokens_mistral': 2157, 'n_tokens_neox': 1747, 'n_words': 480}