<commit_before>import React, { Component, PropTypes } from "react"

import Contributor from "Contributor"

import getI18n from "i18n/get"

export default class TopContributors extends Component {

  static propTypes = {
    recentContributions: PropTypes.object.isRequired,
  }

  static contextTypes = {
    metadata: PropTypes.object.isRequired,
    location: PropTypes.object.isRequired,
  }

  render() {
    const i18n = getI18n(this.context)
    const { recentContributions } = this.props
    const recentContributors = recentContributors
      ? Object.keys(recentContributions)
      : []
    recentContributors.sort(
      (a, b) => (
        recentContributions[b]
        - recentContributions[a]
      )
    )
    const topContributors = recentContributors.slice(0, 8)

    const { metadata } = this.context
    const httpRepository = metadata.pkg.repository.replace(/\.git$/, "")

    return (
      <div>
        <div className="putainde-Title putainde-Title--home">
          <h2 className="putainde-Title-text">
            { i18n.topContributors }
          </h2>
          <small style={ { opacity: .5 } }>
            { i18n.topContributorsNote }
          </small>
        </div>

        <div
          className="r-Grid r-Grid--withGutter"
          style={ { textAlign: "center" } }
        >
          {
            !topContributors.length &&<commit_msg>Fix TopContributors data<commit_after>import React, { Component, PropTypes } from "react"

import Contributor from "Contributor"

import getI18n from "i18n/get"

export default class TopContributors extends Component {

  static propTypes = {
    recentContributions: PropTypes.object.isRequired,
  }

  static contextTypes = {
    metadata: PropTypes.object.isRequired,
    location: PropTypes.object.isRequired,
  }

  render() {
    const i18n = getI18n(this.context)
    const { recentContributions } = this.props
    const recentContributors = recentContributions
      ? Object.keys(recentContributions)
      : []
    recentContributors.sort(
      (a, b) => (
        recentContributions[b]
        - recentContributions[a]
      )
    )
    const topContributors = recentContributors.slice(0, 8)

    const { metadata } = this.context
    const httpRepository = metadata.pkg.repository.replace(/\.git$/, "")

    return (
      <div>
        <div className="putainde-Title putainde-Title--home">
          <h2 className="putainde-Title-text">
            { i18n.topContributors }
          </h2>
          <small style={ { opacity: .5 } }>
            { i18n.topContributorsNote }
          </small>
        </div>

        <div
          className="r-Grid r-Grid--withGutter"
          style={ { textAlign: "center" } }
        >
          {
            !topContributors.length &&
{'fraction_non_alphanumeric': 0.1119942196531792, 'fraction_numerical': 0.012283236994219654, 'mean_word_length': 2.364520048602673, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 21, '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': '1350058', 'n_tokens_mistral': 862, 'n_tokens_neox': 810, 'n_words': 160}