<commit_before>/*!
 * Copyright 2014 The Rust Project Developers. See the COPYRIGHT
 * file at the top-level directory of this distribution and at
 * http://rust-lang.org/COPYRIGHT.
 *
 * Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
 * http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
 * <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
 * option. This file may not be copied, modified, or distributed
 * except according to those terms.
 */

/*jslint browser: true, es5: true */
/*globals $: true, rootPath: true */

(function() {
    "use strict";

    // This mapping table should match the discriminants of
    // `rustdoc::html::item_type::ItemType` type in Rust.
    var itemTypes = ["mod",
                     "externcrate",
                     "import",
                     "struct",
                     "enum",
                     "fn",
                     "type",
                     "static",
                     "trait",
                     "impl",
                     "tymethod",
                     "method",
                     "structfield",
                     "variant",
                     "macro",
                     "primitive",
                     "associatedtype",
                     "constant",
                     "associatedconstant",
                     "union",
                     "foreigntype",
                     "keyword",
                     "existential",
                     "attr",
                     "derive"];

    var search_input = document.getElementsByClassName('search-input')[0];

    // On the search screen, so you remain on the last tab you opened.
    //
    // 0 for "In Names"
    // 1 for "In Parameters"
    // 2 for "In Return Types"
    var currentTab = 0;

    var themesWidth = null;

    var titleBeforeSearch = document.title;

    if (!String.prototype.startsWith) {
        String.prototype.startsWith = function(searchString, position) {
            position = position || 0;
            return this.indexOf(searchString, position) === position;
        };
    }
    if (!String.prototype.endsWith) {
        String.prototype.endsWith = function(suffix, length) {
            var l = length || this.length;
            return this.indexOf(suffix, l - suffix.length) !== -1;
        };
    }

    function getPageId() {
        var id = document.location.href.split('#')[1];
        if (id) {
            return id.split('?')[0].split('&')[0];
        }
        return null;
    }

    function hasClass(elem, className) {
        if (elem && className && elem.className) {
            var elemClass = elem.className;
            var start = elemClass.indexOf(className);
            if (start === -1) {
                return false;
            } else if (elemClass.length === className.length) {
                return true;
            } else {
                if (start > 0 && elemClass[start - 1] !== ' ') {
                    return false;
                }
                var end = start + className.length;
                return !(end < elemClass.length && elemClass[end] !== ' ');
            }
            if (start > 0 && elemClass[start - 1] !== ' ') {
                return false;
            }
            var end = start + className.length;
            return !(end < elemClass.length && elemClass[end] !== ' ');
        }
        return false;
    }

    function addClass(elem, className) {
        if (elem && className && !hasClass(elem, className)) {
            if (elem.className && elem.className.length > 0) {
                elem.className += ' ' + className;
            } else {
                elem.className = className;
            }
        }
    }

    function removeClass(elem, className) {
        if (elem && className && elem.className) {
            elem.className = (" " + elem.className + " ").replace(" " + className + " ", " ")
                                                         .trim();
        }
    }

    function isHidden(elem) {
        return (elem.offsetParent === null)
    }<commit_msg>Remove unreachable code in hasClass function in Rustdoc<commit_after>/*!
 * Copyright 2014 The Rust Project Developers. See the COPYRIGHT
 * file at the top-level directory of this distribution and at
 * http://rust-lang.org/COPYRIGHT.
 *
 * Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
 * http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
 * <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
 * option. This file may not be copied, modified, or distributed
 * except according to those terms.
 */

/*jslint browser: true, es5: true */
/*globals $: true, rootPath: true */

(function() {
    "use strict";

    // This mapping table should match the discriminants of
    // `rustdoc::html::item_type::ItemType` type in Rust.
    var itemTypes = ["mod",
                     "externcrate",
                     "import",
                     "struct",
                     "enum",
                     "fn",
                     "type",
                     "static",
                     "trait",
                     "impl",
                     "tymethod",
                     "method",
                     "structfield",
                     "variant",
                     "macro",
                     "primitive",
                     "associatedtype",
                     "constant",
                     "associatedconstant",
                     "union",
                     "foreigntype",
                     "keyword",
                     "existential",
                     "attr",
                     "derive"];

    var search_input = document.getElementsByClassName('search-input')[0];

    // On the search screen, so you remain on the last tab you opened.
    //
    // 0 for "In Names"
    // 1 for "In Parameters"
    // 2 for "In Return Types"
    var currentTab = 0;

    var themesWidth = null;

    var titleBeforeSearch = document.title;

    if (!String.prototype.startsWith) {
        String.prototype.startsWith = function(searchString, position) {
            position = position || 0;
            return this.indexOf(searchString, position) === position;
        };
    }
    if (!String.prototype.endsWith) {
        String.prototype.endsWith = function(suffix, length) {
            var l = length || this.length;
            return this.indexOf(suffix, l - suffix.length) !== -1;
        };
    }

    function getPageId() {
        var id = document.location.href.split('#')[1];
        if (id) {
            return id.split('?')[0].split('&')[0];
        }
        return null;
    }

    function hasClass(elem, className) {
        if (elem && className && elem.className) {
            var elemClass = elem.className;
            var start = elemClass.indexOf(className);
            if (start === -1) {
                return false;
            } else if (elemClass.length === className.length) {
                return true;
            } else {
                if (start > 0 && elemClass[start - 1] !== ' ') {
                    return false;
                }
                var end = start + className.length;
                return !(end < elemClass.length && elemClass[end] !== ' ');
            }
        }
        return false;
    }

    function addClass(elem, className) {
        if (elem && className && !hasClass(elem, className)) {
            if (elem.className && elem.className.length > 0) {
                elem.className += ' ' + className;
            } else {
                elem.className = className;
            }
        }
    }

    function removeClass(elem, className) {
        if (elem && className && elem.className) {
            elem.className = (" " + elem.className + " ").replace(" " + className + " ", " ")
                                                         .trim();
        }
    }

    function isHidden(elem) {
        return (elem.offsetParent === null)
    }
{'fraction_non_alphanumeric': 0.12188400350745333, 'fraction_numerical': 0.006012777151446824, 'mean_word_length': 1.3983178131571041, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7201939', 'n_tokens_mistral': 2104, 'n_tokens_neox': 1975, 'n_words': 536}