<commit_before>/*
 * Copyright (C) 2012-2020  Online-Go.com
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

import * as React from "react";
import {_, pgettext, getLanguageFlag} from "translate";
import {get} from "requests";
import {Flag} from "Flag";
import {Player} from "Player";
import * as data from "data";

function shuffleArray(array) {
    for (let i = array.length - 1; i >= 0; i--) {
        let j = Math.floor(Math.random() * (i + 1));
        let temp = array[i];
        array[i] = array[j];
        array[j] = temp;
    }
    return array;
}

export class Team extends React.PureComponent<{}, any> {
    constructor(props) {
        super(props);
        this.state = {
            contributors: []
        };
    }

    UNSAFE_componentWillMount() {
        get('https://api.github.com/repos/online-go/online-go.com/contributors?per_page=100')
        .then((list) => {
            this.setState({contributors: list});
        })
        .catch((err) => {
            console.error(err);
        });
    }

    render() {
        let user = data.get("user");


        let country = user ? user.country : "gb";

        let fr = getLanguageFlag("french", country, "fr");
        let en = getLanguageFlag("english", country, "us");
        let es = getLanguageFlag("spanish", country, "es");
        let de = getLanguageFlag("german", country, "de");
        let cn = getLanguageFlag("chinese", country, "cn");
        let hi = getLanguageFlag("hindi", country, "in");
        let gb = getLanguageFlag("gb", country, "gb");
        let se = getLanguageFlag("swedish", country, "se");
        let cz = getLanguageFlag("czech", country, "cz");

        let moderators = [
            {"id": 784    , "username": "mlopezviedma"   , "country": ["ar"] , "languages": [es, en]} ,
            {"id": 781    , "username": "crodgers"       , "country": ["us"] , "languages": [en]} ,
            {"id": 69627  , "username": "xhu98"          , "country": ["us"] , "languages": [cn, en]} ,
            {"id": 4      , "username": "matburt"        , "country": ["us"] , "languages": [en]} ,
            {"id": 1      , "username": "anoek"          , "country": ["us"] , "languages": [en]} ,
            {"id": 52     , "username": "trohde"         , "country": ["de"] , "languages": [de, en]} ,
            {"id": 64817  , "username": "mark5000"       , "country": ["us"] , "languages": [en]} ,
            {"id": 66091  , "username": "Revar Isavé"    , "country": ["de"] , "languages": [de, gb]} ,
            {"id": 441    , "username": "VincentCB"      , "country": ["ca"] , "languages": [en, fr]} ,
            {"id": 55415  , "username": "entrpy"         , "country": ["se"] , "languages": [se, en]} ,
            {"id": 360861 , "username": "AdamR"          , "country": ["cz"] , "languages": [cz, en]} ,
            {"id": 299041 , "username": "Razza99"        , "country": ["gb"] , "languages": [en]} ,<commit_msg>Update Team.tsx<commit_after>/*
 * Copyright (C) 2012-2020  Online-Go.com
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

import * as React from "react";
import {_, pgettext, getLanguageFlag} from "translate";
import {get} from "requests";
import {Flag} from "Flag";
import {Player} from "Player";
import * as data from "data";

function shuffleArray(array) {
    for (let i = array.length - 1; i >= 0; i--) {
        let j = Math.floor(Math.random() * (i + 1));
        let temp = array[i];
        array[i] = array[j];
        array[j] = temp;
    }
    return array;
}

export class Team extends React.PureComponent<{}, any> {
    constructor(props) {
        super(props);
        this.state = {
            contributors: []
        };
    }

    UNSAFE_componentWillMount() {
        get('https://api.github.com/repos/online-go/online-go.com/contributors?per_page=100')
        .then((list) => {
            this.setState({contributors: list});
        })
        .catch((err) => {
            console.error(err);
        });
    }

    render() {
        let user = data.get("user");


        let country = user ? user.country : "gb";

        let fr = getLanguageFlag("french", country, "fr");
        let en = getLanguageFlag("english", country, "us");
        let es = getLanguageFlag("spanish", country, "es");
        let de = getLanguageFlag("german", country, "de");
        let cn = getLanguageFlag("chinese", country, "cn");
        let hi = getLanguageFlag("hindi", country, "in");
        let gb = getLanguageFlag("gb", country, "gb");
        let se = getLanguageFlag("swedish", country, "se");
        let cz = getLanguageFlag("czech", country, "cz");
        let nl = getLanguageFlag("netherlands", country, "nl");
        let jp = getLanguageFlag("japan", country, "jp");

        let moderators = [
            {"id": 784    , "username": "mlopezviedma"   , "country": ["ar"] , "languages": [es, en]} ,
            {"id": 781    , "username": "crodgers"       , "country": ["us"] , "languages": [en]} ,
            {"id": 69627  , "username": "xhu98"          , "country": ["us"] , "languages": [cn, en]} ,
            {"id": 4      , "username": "matburt"        , "country": ["us"] , "languages": [en]} ,
            {"id": 1      , "username": "anoek"          , "country": ["us"] , "languages": [en]} ,
            {"id": 52     , "username": "trohde"         , "country": ["de"] , "languages": [de, en]} ,
            {"id": 64817  , "username": "mark5000"       , "country": ["us"] , "languages": [en]} ,
            {"id": 66091  , "username": "Revar Isavé"    , "country": ["de"] , "languages": [de, gb]} ,
            {"id": 441    , "username": "VincentCB"      , "country": ["ca"] , "languages": [en, fr]} ,
            {"id": 55415  , "username": "entrpy"         , "country": ["se"] , "languages": [se, en]} ,
            {"id": 360861 , "username": "AdamR"          , "country": ["cz"] , "languages": [cz, en]} ,
            {"id": 299041 , "username": "Razza99"        , "country": ["gb"] , "languages": [en]} ,
{'fraction_non_alphanumeric': 0.17584394023242944, 'fraction_numerical': 0.018815716657443277, 'mean_word_length': 2.4805007221954742, 'pattern_counts': {'":': 96, '<': 7, '<?xml version=': 0, '>': 13, 'https://': 2, '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': '1646315', 'n_tokens_mistral': 2338, 'n_tokens_neox': 2213, 'n_words': 681}