<commit_before>"use strict";

import $ from "jquery";
import _ from "lodash";
import React from "react";
import {Link} from "react-router";
import {Grid, Row, Col, Glyphicon} from "react-bootstrap";

import Article from "./article";
import "./news.less"


export default React.createClass({
  displayName: "NewsContainer",

  getInitialState() {
    return {
      currentNewsPage: 1,
      newsPerPage: 2,
      canShowNext: false,
      canShowPrevious: false,
      news: [],
      pinned: {}
    };
  },

  componentDidMount() {
    $.ajax({
      method: "GET",
      url: window.config.API_URL + "news.json",
      success: this.onSuccess,
    });
  },

  onSuccess(data) {
    let news = data.filter((article) => {
      return !article.pinned;
    });

    let pinned = _.difference(data, news)
    if (!pinned.length) {
      pinned = news.slice(0, 1);
      news = news.slice(1);<commit_msg>Fix build. #140<commit_after>"use strict";

import $ from "jquery";
import _ from "lodash";
import React from "react";
import {Link} from "react-router";
import {Grid, Row, Col, Glyphicon} from "react-bootstrap";

import Article from "./article";
import "./news.less"


export default React.createClass({
  displayName: "NewsContainer",

  getInitialState() {
    return {
      currentNewsPage: 1,
      newsPerPage: 2,
      canShowNext: false,
      canShowPrevious: false,
      news: [],
      pinned: {}
    };
  },

  componentDidMount() {
    $.ajax({
      method: "GET",
      url: window.config.API_URL + "news.json",
      success: this.onSuccess
    });
  },

  onSuccess(data) {
    let news = data.filter((article) => {
      return !article.pinned;
    });

    let pinned = _.difference(data, news);
    if (!pinned.length) {
      pinned = news.slice(0, 1);
      news = news.slice(1);
{'fraction_non_alphanumeric': 0.15188470066518847, 'fraction_numerical': 0.007206208425720621, 'mean_word_length': 2.808016877637131, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6945462', 'n_tokens_mistral': 600, 'n_tokens_neox': 575, 'n_words': 145}