<commit_before>const allEqual = arr => arr.every( v => v === arr[0] );

var shuffle = function (array) {

	var currentIndex = array.length;
	var temporaryValue, randomIndex;

	// While there remain elements to shuffle...
	while (0 !== currentIndex) {
		// Pick a remaining element...
		randomIndex = Math.floor(Math.random() * currentIndex);
		currentIndex -= 1;

		// And swap it with the current element.
		temporaryValue = array[currentIndex];
		array[currentIndex] = array[randomIndex];
		array[randomIndex] = temporaryValue;
	}

	return array;

};

var GameState = function(n_cards, player_names) {
	this.n_images = 160;
	this.n_players = player_names.length;
	this.player_names = player_names.slice();
	this.cards_per_player = 6;
	this.n_cards = n_cards;
	this.deck_order = [...Array(this.n_images).keys()];
	this.stage = 0;  // 0 - Mano picks card and text; 1 - Players pick cards; 2 - Votes; 3 - Results
	this.turn = 0;
	this.deck_index = 0;
	this.song = "";
	this.player_hands = [];
	this.candidates = [];
	this.candidates_shown = [];
	this.votes = [];
	this.scores = [];
    // refresh is not really a state but a message field. When we do
	// a state update that does not require refreshing (e.g., a proposal),
	// we still must publish it, it is not enough that the chief keeps
	// track of the change, because if the chief reloads, it will get the
	// state from the topic and forget about the non-refresh state change.
	// So we always publish the new state, but the topic listener checks<commit_msg>Update gamestate.js<commit_after>const allEqual = arr => arr.every( v => v === arr[0] );

var shuffle = function (array) {

	var currentIndex = array.length;
	var temporaryValue, randomIndex;

	// While there remain elements to shuffle...
	while (0 !== currentIndex) {
		// Pick a remaining element...
		randomIndex = Math.floor(Math.random() * currentIndex);
		currentIndex -= 1;

		// And swap it with the current element.
		temporaryValue = array[currentIndex];
		array[currentIndex] = array[randomIndex];
		array[randomIndex] = temporaryValue;
	}

	return array;

};

var GameState = function(n_cards, player_names) {
	this.n_images = 170;
	this.n_players = player_names.length;
	this.player_names = player_names.slice();
	this.cards_per_player = 6;
	this.n_cards = n_cards;
	this.deck_order = [...Array(this.n_images).keys()];
	this.stage = 0;  // 0 - Mano picks card and text; 1 - Players pick cards; 2 - Votes; 3 - Results
	this.turn = 0;
	this.deck_index = 0;
	this.song = "";
	this.player_hands = [];
	this.candidates = [];
	this.candidates_shown = [];
	this.votes = [];
	this.scores = [];
    // refresh is not really a state but a message field. When we do
	// a state update that does not require refreshing (e.g., a proposal),
	// we still must publish it, it is not enough that the chief keeps
	// track of the change, because if the chief reloads, it will get the
	// state from the topic and forget about the non-refresh state change.
	// So we always publish the new state, but the topic listener checks
{'fraction_non_alphanumeric': 0.12294001318391562, 'fraction_numerical': 0.00922874093605801, 'mean_word_length': 3.5230998509687033, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '6915095', 'n_tokens_mistral': 1008, 'n_tokens_neox': 947, 'n_words': 330}