<commit_before>// @flow
import * as React from "react";
import { Row, Col, Spin, Table, Card } from "antd";
import moment from "moment";
import Request from "libs/request";
import Utils from "libs/utils";
import C3Chart from "react-c3js";

const { Column } = Table;

type State = {
  achievements: {
    numberOfUsers: number,
    numberOfDatasets: number,
    numberOfAnnotations: number,
    numberOfTrees: number,
    numberOfOpenAssignments: number,
  },
  timeEntries: Array<*>,
  isAchievementsLoading: boolean,
  isTimeEntriesLoading: boolean,
  startDate: moment$Moment,
  endDate: moment$Moment,
};

class StatisticView extends React.PureComponent<{}, State> {
  state = {
    isAchievementsLoading: true,
    isTimeEntriesLoading: true,
    startDate: moment().startOf("week"),
    endDate: moment().endOf("week"),
    timeEntries: [],
    achievements: {
      numberOfUsers: 0,
      numberOfDatasets: 0,
      numberOfAnnotations: 0,
      numberOfTrees: 0,
      numberOfOpenAssignments: 0,
    },
  };

  componentDidMount() {
    moment.updateLocale("en", { week: { dow: 1 } });

    this.fetchAchievementData();<commit_msg>applied PR feedback #2013<commit_after>// @flow
import * as React from "react";
import { Row, Col, Spin, Table, Card } from "antd";
import moment from "moment";
import Request from "libs/request";
import Utils from "libs/utils";
import C3Chart from "react-c3js";

const { Column } = Table;

type State = {
  achievements: {
    numberOfUsers: number,
    numberOfDatasets: number,
    numberOfAnnotations: number,
    numberOfTrees: number,
    numberOfOpenAssignments: number,
  },
  timeEntries: Array<{
    start: string,
    end: string,
    tracingTime: number,
  }>,
  isAchievementsLoading: boolean,
  isTimeEntriesLoading: boolean,
  startDate: moment$Moment,
  endDate: moment$Moment,
};

class StatisticView extends React.PureComponent<{}, State> {
  state = {
    isAchievementsLoading: true,
    isTimeEntriesLoading: true,
    startDate: moment().startOf("week"),
    endDate: moment().endOf("week"),
    timeEntries: [],
    achievements: {
      numberOfUsers: 0,
      numberOfDatasets: 0,
      numberOfAnnotations: 0,
      numberOfTrees: 0,
      numberOfOpenAssignments: 0,
    },
  };

  componentDidMount() {
    moment.updateLocale("en", { week: { dow: 1 } });

    this.fetchAchievementData();
{'fraction_non_alphanumeric': 0.12388629613915995, 'fraction_numerical': 0.00848536274925753, 'mean_word_length': 3.8220858895705523, 'pattern_counts': {'":': 0, '<': 7, '<?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': '3521283', 'n_tokens_mistral': 771, 'n_tokens_neox': 757, 'n_words': 186}