<commit_before>// bufferish-proto.js

/* jshint eqnull:true */

exports.copy = copy;
exports.slice = slice;
exports.readDoubleBE = gen("readDoubleBE");
exports.readFloatBE = gen("readFloatBE");
exports.writeDoubleBE = gen("writeDoubleBE");
exports.writeFloatBE = gen("writeFloatBE");

var Bufferish = require("./bufferish");
var BufferLite = require("./buffer-lite");

/**
 * @param target {Buffer|Uint8Array|Array}
 * @param [targetStart] {Number}
 * @param [start] {Number}
 * @param [end] {Number}
 * @returns {Buffer|Uint8Array|Array}
 */

function copy(target, targetStart, start, end) {
  if (Bufferish.isBuffer(this) && Bufferish.isBuffer(target)) {
    // Buffer to Buffer
    return this.copy(target, targetStart, start, end);
  } else if (Bufferish.isView(this) && Bufferish.isView(target)) {
    // Uint8Array to Uint8Array
    var buffer = (start || end != null) ? slice.call(this, start, end) : this;
    target.set(buffer, targetStart);
    return buffer.length;
  } else {
    // other cases
    return BufferLite.copy.call(this, target, targetStart, start, end);
  }
}

/**
 * @param [start] {Number}
 * @param [end] {Number}
 * @returns {Buffer|Uint8Array|Array}
 */

function slice(start, end) {<commit_msg>Buffer based on TypedArray on node v4<commit_after>// bufferish-proto.js

/* jshint eqnull:true */

exports.copy = copy;
exports.slice = slice;
exports.readDoubleBE = gen("readDoubleBE");
exports.readFloatBE = gen("readFloatBE");
exports.writeDoubleBE = gen("writeDoubleBE");
exports.writeFloatBE = gen("writeFloatBE");

var Bufferish = require("./bufferish");
var BufferLite = require("./buffer-lite");

/**
 * @param target {Buffer|Uint8Array|Array}
 * @param [targetStart] {Number}
 * @param [start] {Number}
 * @param [end] {Number}
 * @returns {Buffer|Uint8Array|Array}
 */

function copy(target, targetStart, start, end) {
  var thisIsBuffer = Bufferish.isBuffer(this);
  var targetIsBuffer = Bufferish.isBuffer(target);
  if (thisIsBuffer && targetIsBuffer) {
    // Buffer to Buffer
    return this.copy(target, targetStart, start, end);
  } else if (!thisIsBuffer && !targetIsBuffer && Bufferish.isView(this) && Bufferish.isView(target)) {
    // Uint8Array to Uint8Array
    var buffer = (start || end != null) ? slice.call(this, start, end) : this;
    target.set(buffer, targetStart);
    return buffer.length;
  } else {
    // other cases
    return BufferLite.copy.call(this, target, targetStart, start, end);
  }
}

/**
 * @param [start] {Number}
 * @param [end] {Number}
 * @returns {Buffer|Uint8Array|Array}
 */

function slice(start, end) {
{'fraction_non_alphanumeric': 0.16021671826625386, 'fraction_numerical': 0.0042569659442724455, 'mean_word_length': 4.442105263157894, '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': '6053852', 'n_tokens_mistral': 848, 'n_tokens_neox': 849, 'n_words': 198}