<commit_before>"use strict";
var $stream = null,
	isCollapsed = true;

function is_normal_mode() {
	return $stream.hasClass('normal');
}

function is_global_mode() {
	return $stream.hasClass('global');
}

function redirect(url, new_tab) {
	if (url) {
		if (new_tab) {
			window.open(url);
		} else {
			location.href = url;
		}
	}
}

function numberFormat(nStr) {
	// http://www.mredkj.com/javascript/numberFormat.html
	nStr += '';
	var x = nStr.split('.'),
		x1 = x[0],
		x2 = x.length > 1 ? '.' + x[1] : '',
		rgx = /(\d+)(\d{3})/;
	while (rgx.test(x1)) {
		x1 = x1.replace(rgx, '$1' + ' ' + '$2');
	}
	return x1 + x2;
}

function incLabel(p, inc) {
	var i = (parseInt(p.replace(/\D/g, ''), 10) || 0) + inc;
	return i > 0 ? ' (' + numberFormat(i) + ')' : '';
}

function incUnreadsFeed(article, feed_id, nb) {
	
	//Update unread: feed
	var elem = $('#' + feed_id + '>.feed').get(0),
		feed_unreads = elem ? (parseInt(elem.getAttribute('data-unread').replace(' ', ''), 10) || 0) : 0,
		feed_priority = elem ? (parseInt(elem.getAttribute('data-priority'), 10) || 0) : 0;
	if (elem) {
		elem.setAttribute('data-unread', numberFormat(Math.max(0, feed_unreads + nb)));
	}

	//Update unread: category
	elem = $('#' + feed_id).parent().prevAll('.category').children(':first').get(0);
	feed_unreads = elem ? (parseInt(elem.getAttribute('data-unread').replace(' ', ''), 10) || 0) : 0;
	if (elem) {
		elem.setAttribute('data-unread', numberFormat(Math.max(0, feed_unreads + nb)));
	}

	//Update unread: all
	if (feed_priority > 0) {
		elem = $('#aside_flux .all').children(':first').get(0);
		if (elem) {
			feed_unreads = elem ? (parseInt(elem.getAttribute('data-unread').replace(' ', ''), 10) || 0) : 0;
			elem.setAttribute('data-unread', numberFormat(Math.max(0, feed_unreads + nb)));
		}
	}

	//Update unread: favourites
	if (article && article.closest('div').hasClass('favorite')) {
		elem = $('#aside_flux .favorites').children(':first').get(0);
		if (elem) {
			feed_unreads = elem ? (parseInt(elem.getAttribute('data-unread').replace(' ', ''), 10) || 0) : 0;
			elem.setAttribute('data-unread', numberFormat(Math.max(0, feed_unreads + nb)));
		}
	}

	var isCurrentView = false;
	//Update unread: title
	document.title = document.title.replace(/((?: \(\d+\))?)( · .*?)((?: \(\d+\))?)$/, function (m, p1, p2, p3) {
		var $feed = $('#' + feed_id);
		if (article || ($feed.closest('.active').length > 0 && $feed.siblings('.active').length === 0)) {
			isCurrentView = true;
			return incLabel(p1, nb) + p2 + incLabel(p3, feed_priority > 0 ? nb : 0);
		} else {
			return p1 + p2 + incLabel(p3, feed_priority > 0 ? nb : 0);
		}
	});
	return isCurrentView;
}

function mark_read(active, only_not_read) {
	if (active.length === 0 || (only_not_read === true && !active.hasClass("not_read"))) {
		return false;
	}

	var url = active.find("a.read").attr("href");
	if (url === undefined) {
		return false;<commit_msg>Corrige mise à jour titre en JavaScript<commit_after>"use strict";
var $stream = null,
	isCollapsed = true;

function is_normal_mode() {
	return $stream.hasClass('normal');
}

function is_global_mode() {
	return $stream.hasClass('global');
}

function redirect(url, new_tab) {
	if (url) {
		if (new_tab) {
			window.open(url);
		} else {
			location.href = url;
		}
	}
}

function numberFormat(nStr) {
	// http://www.mredkj.com/javascript/numberFormat.html
	nStr += '';
	var x = nStr.split('.'),
		x1 = x[0],
		x2 = x.length > 1 ? '.' + x[1] : '',
		rgx = /(\d+)(\d{3})/;
	while (rgx.test(x1)) {
		x1 = x1.replace(rgx, '$1' + ' ' + '$2');
	}
	return x1 + x2;
}

function incLabel(p, inc) {
	var i = (parseInt(p.replace(/\D/g, ''), 10) || 0) + inc;
	return i > 0 ? ' (' + numberFormat(i) + ')' : '';
}

function incUnreadsFeed(article, feed_id, nb) {
	
	//Update unread: feed
	var elem = $('#' + feed_id + '>.feed').get(0),
		feed_unreads = elem ? (parseInt(elem.getAttribute('data-unread').replace(' ', ''), 10) || 0) : 0,
		feed_priority = elem ? (parseInt(elem.getAttribute('data-priority'), 10) || 0) : 0;
	if (elem) {
		elem.setAttribute('data-unread', numberFormat(Math.max(0, feed_unreads + nb)));
	}

	//Update unread: category
	elem = $('#' + feed_id).parent().prevAll('.category').children(':first').get(0);
	feed_unreads = elem ? (parseInt(elem.getAttribute('data-unread').replace(' ', ''), 10) || 0) : 0;
	if (elem) {
		elem.setAttribute('data-unread', numberFormat(Math.max(0, feed_unreads + nb)));
	}

	//Update unread: all
	if (feed_priority > 0) {
		elem = $('#aside_flux .all').children(':first').get(0);
		if (elem) {
			feed_unreads = elem ? (parseInt(elem.getAttribute('data-unread').replace(' ', ''), 10) || 0) : 0;
			elem.setAttribute('data-unread', numberFormat(Math.max(0, feed_unreads + nb)));
		}
	}

	//Update unread: favourites
	if (article && article.closest('div').hasClass('favorite')) {
		elem = $('#aside_flux .favorites').children(':first').get(0);
		if (elem) {
			feed_unreads = elem ? (parseInt(elem.getAttribute('data-unread').replace(' ', ''), 10) || 0) : 0;
			elem.setAttribute('data-unread', numberFormat(Math.max(0, feed_unreads + nb)));
		}
	}

	var isCurrentView = false;
	//Update unread: title
	document.title = document.title.replace(/^([^\(]*)((?: \([0-9 ]+\))?)( · .*?)((?: \([0-9 ]+\))?)$/, function(m, p1, p2, p3, p4) {
		var $feed = $('#' + feed_id);

		p2 = p2.replace(/ /g, '');
		p4 = p4.replace(/ /g, '');

		if ($('.category.all > .active').length == 0 && $('.category.favorites > .active').length == 0) { // If the current page is not the home page or the favorites page
			isCurrentView = true;
			return p1 + incLabel(p2, nb) + p3 + incLabel(p4, feed_priority > 0 ? nb : 0);
		} else {
			return p1 + p3 + incLabel(p4, feed_priority > 0 ? nb : 0);
		}

	});

	return isCurrentView;
}

function mark_read(active, only_not_read) {
	if (active.length === 0 || (only_not_read === true && !active.hasClass("not_read"))) {
		return false;
	}

	var url = active.find("a.read").attr("href");
	if (url === undefined) {
		return false;
{'fraction_non_alphanumeric': 0.22609711329884866, 'fraction_numerical': 0.022359419322542966, 'mean_word_length': 3.86525974025974, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5677499', 'n_tokens_mistral': 2493, 'n_tokens_neox': 2319, 'n_words': 460}