<commit_before>/*
 * @package jsDAV
 * @subpackage DAV
 * @copyright Copyright (C) 2010 <NAME>. All rights reserved.
 * @author <NAME> <<EMAIL>>
 * @license http://github.com/mikedeboer/jsDAV/blob/master/LICENSE MIT License
 */
var jsDAV = require("./../jsdav"),
    Url   = require("url"),
    Path  = require("path"),
    //Xml  = require("./../../vendor/node-xml/lib/node-xml"),
    Async = require("./../../vendor/async.js/lib/async/index"),
    Xml   = require("./../../vendor/node-o3-xml/lib/o3-xml"),
    Exc   = require("./exceptions");

Function.prototype.bind = function(context /*, arg1, arg2... */) {
    if (typeof this !== 'function') throw new TypeError();
    var _arguments = Array.prototype.slice.call(arguments, 1),
        _this = this,
        _concat = Array.prototype.concat,
        _function = function() {
            return _this.apply(this instanceof _dummy ? this : context,
                _concat.apply(_arguments, arguments));
        },
        _dummy = function() {};
    _dummy.prototype = _this.prototype;
    _function.prototype = new _dummy();
    return _function;
};

/**
 * Make sure that an array instance contains only unique values (NO duplicates).
 *
 * @type {Array}
 */
exports.makeUnique = function(arr){
    var i, length, newArr = [];
    for (i = 0, length = arr.length; i < length; i++)
        if (newArr.indexOf(arr[i]) == -1)
            newArr.push(arr[i]);

    arr.length = 0;
    for (i = 0, length = newArr.length; i < length; i++)
        arr.push(newArr[i]);

    return arr;
};

/**
 * Search for a value 'obj' inside an array instance and remove it when found.
 *
 * @param {Array} arr
 * @param {mixed} obj
 * @type  {Array}
 */
exports.arrayRemove = function(arr, obj) {
    for (var i = arr.length - 1; i >= 0; i--) {
        if (arr[i] != obj)
            continue;
<commit_msg>overwrite Function.prototype.bind only in debugMode<commit_after>/*
 * @package jsDAV
 * @subpackage DAV
 * @copyright Copyright (C) 2010 <NAME>. All rights reserved.
 * @author <NAME> <<EMAIL>>
 * @license http://github.com/mikedeboer/jsDAV/blob/master/LICENSE MIT License
 */
var jsDAV = require("./../jsdav"),
    Url   = require("url"),
    Path  = require("path"),
    //Xml  = require("./../../vendor/node-xml/lib/node-xml"),
    Async = require("./../../vendor/async.js/lib/async/index"),
    Xml   = require("./../../vendor/node-o3-xml/lib/o3-xml"),
    Exc   = require("./exceptions");

if (jsDAV.debugMode) {
    Function.prototype.bind = function(context /*, arg1, arg2... */) {
        if (typeof this !== 'function') throw new TypeError();
        var _arguments = Array.prototype.slice.call(arguments, 1),
            _this = this,
            _concat = Array.prototype.concat,
            _function = function() {
                return _this.apply(this instanceof _dummy ? this : context,
                    _concat.apply(_arguments, arguments));
            },
            _dummy = function() {};
        _dummy.prototype = _this.prototype;
        _function.prototype = new _dummy();
        return _function;
    };
}

/**
 * Make sure that an array instance contains only unique values (NO duplicates).
 *
 * @type {Array}
 */
exports.makeUnique = function(arr){
    var i, length, newArr = [];
    for (i = 0, length = arr.length; i < length; i++)
        if (newArr.indexOf(arr[i]) == -1)
            newArr.push(arr[i]);

    arr.length = 0;
    for (i = 0, length = newArr.length; i < length; i++)
        arr.push(newArr[i]);

    return arr;
};

/**
 * Search for a value 'obj' inside an array instance and remove it when found.
 *
 * @param {Array} arr
 * @param {mixed} obj
 * @type  {Array}
 */
exports.arrayRemove = function(arr, obj) {
    for (var i = arr.length - 1; i >= 0; i--) {
        if (arr[i] != obj)
            continue;

{'fraction_non_alphanumeric': 0.17239569666754131, 'fraction_numerical': 0.007871949619522435, 'mean_word_length': 2.391459074733096, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, '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': '6151106', 'n_tokens_mistral': 1237, 'n_tokens_neox': 1195, 'n_words': 316}