<commit_before>var $ = require('jquery');
var tape = require('tape');
var raf = require('../lib/raf.js');

$.fn.isAfter = function(el) {
	return $(el).nextAll(this).length > 0;
};

$.fn.isBefore = function(el) {
	return $(el).prevAll(this).length > 0;
};

$.fn.contains = function(el) {
	return this.has(el).length > 0;
};

$.fn.btnClick = function(which) {
	var e = $.Event('mousedown');
	e.which = which || 1;
	this.trigger(e);
}

function waitForAnimation(fn) {
	raf(function() {
		process.nextTick(fn);
	});
}

function move(pos, el) {
	var e = $.Event('mousemove');
	e.clientX = e.pageX = pos.x;
	e.clientY = e.pageY = pos.y;
	$(el || document).trigger(e);
}

function step(steps, cb) {
	if(steps.length) {
		waitForAnimation(function() {
			steps[0]();
			step(steps.slice(1), cb);
		});
	} else {
		cb();
	}
}

var end = tape.Test.prototype.end;
tape.Test.prototype.end = function() {
	$('body').empty().removeClass();
	end.apply(this, arguments);
}

function valuesEqual(a, b) {
	return a.length === b.length && a.every(function(av, i) {
		var bv = b[i];
		return floatEqual(av[0], bv[0]) && floatEqual(av[1], bv[1]);
	});
}

function floatEqual(a, b) {
	return Math.abs(a - b) < 1e-10
}

tape.Test.prototype.rangebarValuesEqual = function(a, b, msg, extra) {
	this._assert(valuesEqual(a, b), {
			message : msg || 'rangebar values should be equal',
			operator : 'equal',
			actual : a,
			expected : b,
			extra : extra
	});
}

tape.Test.prototype.floatEqual = function(a, b, msg, extra) {
	this._assert(floatEqual(a, b), {
			message : msg || 'floats should be equal',
			operator : 'equal',
			actual : a,
			expected : b,<commit_msg>fix: relax float boundaries to make ie pass<commit_after>var $ = require('jquery');
var tape = require('tape');
var raf = require('../lib/raf.js');

$.fn.isAfter = function(el) {
	return $(el).nextAll(this).length > 0;
};

$.fn.isBefore = function(el) {
	return $(el).prevAll(this).length > 0;
};

$.fn.contains = function(el) {
	return this.has(el).length > 0;
};

$.fn.btnClick = function(which) {
	var e = $.Event('mousedown');
	e.which = which || 1;
	this.trigger(e);
}

function waitForAnimation(fn) {
	raf(function() {
		process.nextTick(fn);
	});
}

function move(pos, el) {
	var e = $.Event('mousemove');
	e.clientX = e.pageX = pos.x;
	e.clientY = e.pageY = pos.y;
	$(el || document).trigger(e);
}

function step(steps, cb) {
	if(steps.length) {
		waitForAnimation(function() {
			steps[0]();
			step(steps.slice(1), cb);
		});
	} else {
		cb();
	}
}

var end = tape.Test.prototype.end;
tape.Test.prototype.end = function() {
	$('body').empty().removeClass();
	end.apply(this, arguments);
}

function valuesEqual(a, b) {
	return a.length === b.length && a.every(function(av, i) {
		var bv = b[i];
		return floatEqual(av[0], bv[0]) && floatEqual(av[1], bv[1]);
	});
}

function floatEqual(a, b) {
	return Math.abs(a - b) < 1
}

tape.Test.prototype.rangebarValuesEqual = function(a, b, msg, extra) {
	this._assert(valuesEqual(a, b), {
			message : msg || 'rangebar values should be equal',
			operator : 'equal',
			actual : a,
			expected : b,
			extra : extra
	});
}

tape.Test.prototype.floatEqual = function(a, b, msg, extra) {
	this._assert(floatEqual(a, b), {
			message : msg || 'floats should be equal',
			operator : 'equal',
			actual : a,
			expected : b,
{'fraction_non_alphanumeric': 0.20253164556962025, 'fraction_numerical': 0.007233273056057866, 'mean_word_length': 3.775539568345324, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '1945203', 'n_tokens_mistral': 1347, 'n_tokens_neox': 1277, 'n_words': 270}