<commit_before>export class Bucketer {

	constructor(experiment, session) {
		this.experiment = experiment;
		this.session = session;
	}

	variant() {
		var variant = this.session.variant(this.experiment);
		return variant;
	}

}<commit_msg>feat: Bucketer assigns to bucket if not already bucketed<commit_after>export class Bucketer {

	constructor(experiment, variants, session) {
		this.experiment = experiment;
		this.variants = variants;
		this.session = session;
	}

	variant() {
		var variant = this.session.variant(this.experiment);

		if (!variant) {
			var limit = 1/this.variants.length;
			var random = Math.random();
			var index = Math.floor(((random * 10) - 0.1) / (limit * 10));
			variant = this.variants[index];
		}

		return variant;
	}

}
{'fraction_non_alphanumeric': 0.12813738441215325, 'fraction_numerical': 0.009247027741083224, 'mean_word_length': 3.858974358974359, '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': '3462905', 'n_tokens_mistral': 275, 'n_tokens_neox': 239, 'n_words': 58}