<commit_before>import "react-hot-loader/patch";

let seed = 1;
function random() {
    const x = Math.sin(seed++ + 0.59322) * 10000;
    return x - Math.floor(x);
}

Math.random = random;

import * as _ from "lodash";
import * as Perf from "react-addons-perf";
import * as ReactDOM from "react-dom";
import * as React from "react";
import { AppContainer } from "react-hot-loader";
import { Provider } from "react-redux";
import * as Redux from "redux";
import { batchedSubscribe } from "redux-batched-subscribe";
import thunk from "redux-thunk";

import { Main as InitialMain } from "components/main";
import reducer from "reducer";
import { IState } from "state";
import { buildInitialState } from "initialState";
import DEBUG_FLAGS from "debugFlags";

import "./index.less";

(window as any).Perf = Perf;<commit_msg>allow setting a seed through the browser<commit_after>import "react-hot-loader/patch";

let seed: number | null = null;

const queryParamMatch = window.location.search.slice(1).match(/seed=(\d+)/);
if (queryParamMatch != null) {
    seed = parseInt(queryParamMatch[1], 10);
}

function isNumeric(n: any): n is number {
  return !isNaN(parseFloat(n)) && isFinite(n);
}

if (!isNumeric(seed)) {
    seed = Date.now();
}

function random() {
    const x = Math.sin(seed++ + 0.59322) * 10000;
    return x - Math.floor(x);
}

Math.random = random;

import * as _ from "lodash";
import * as Perf from "react-addons-perf";
import * as ReactDOM from "react-dom";
import * as React from "react";
import { AppContainer } from "react-hot-loader";
import { Provider } from "react-redux";
import * as Redux from "redux";
import { batchedSubscribe } from "redux-batched-subscribe";
import thunk from "redux-thunk";

import { Main as InitialMain } from "components/main";
import reducer from "reducer";
import { IState } from "state";
import { buildInitialState } from "initialState";
import DEBUG_FLAGS from "debugFlags";

import "./index.less";

(window as any).Perf = Perf;
{'fraction_non_alphanumeric': 0.14444444444444443, 'fraction_numerical': 0.013636363636363636, 'mean_word_length': 4.518105849582173, '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': '4758396', 'n_tokens_mistral': 670, 'n_tokens_neox': 641, 'n_words': 199}