<commit_before>import React from 'react'
import ReactPaginate from 'react-paginate'

import EventListItem from './EventListItem'

export class EventsList extends React.Component {
  constructor(props) {
    super(props)
    this.renderEventListItems = this.renderEventListItems.bind(this)
    this.handlePageClick = this.handlePageClick.bind(this)
    this.renderPagination = this.renderPagination.bind(this)
  }
  renderEventListItems() {
    const { events } = this.props
    let eventsList = []
    const sortFunction = function(a,b) {
      if(Date.parse(a.date) < Date.parse(b.date))
        return -1
      if(Date.parse(a.date) > Date.parse(b.date))
        return 1
      return 0
    }
    events.sort(sortFunction).map((event) => {
      eventsList.push(<EventListItem 
                        event={event}
                        key={event.id}/>)
    })
    return eventsList
  }
  handlePageClick(data) {
    this.props.getEvents(data.selected + 1)
  }
  renderPagination() {
    return (
        <li className="list-group-item">
          <ReactPaginate previousLabel={"<"}
                         pageNum={this.props.count/10 + 1}
                         nextLabel={">"}
                         breakLabel={<a>...</a>}
                         breakClassName={"break-me"}
                         clickCallback={this.handlePageClick}<commit_msg>Proper event count dividing<commit_after>import React from 'react'
import ReactPaginate from 'react-paginate'

import EventListItem from './EventListItem'

export class EventsList extends React.Component {
  constructor(props) {
    super(props)
    this.renderEventListItems = this.renderEventListItems.bind(this)
    this.handlePageClick = this.handlePageClick.bind(this)
    this.renderPagination = this.renderPagination.bind(this)
  }
  renderEventListItems() {
    const { events } = this.props
    let eventsList = []
    const sortFunction = function(a,b) {
      if(Date.parse(a.date) < Date.parse(b.date))
        return -1
      if(Date.parse(a.date) > Date.parse(b.date))
        return 1
      return 0
    }
    events.sort(sortFunction).map((event) => {
      eventsList.push(<EventListItem 
                        event={event}
                        key={event.id}/>)
    })
    return eventsList
  }
  handlePageClick(data) {
    this.props.getEvents(data.selected + 1)
  }
  renderPagination() {
    return (
        <li className="list-group-item">
          <ReactPaginate previousLabel={"<"}
                         pageNum={this.props.count/5}
                         nextLabel={">"}
                         breakLabel={<a>...</a>}
                         breakClassName={"break-me"}
                         clickCallback={this.handlePageClick}
{'fraction_non_alphanumeric': 0.12020460358056266, 'fraction_numerical': 0.004384362440628425, 'mean_word_length': 2.154377880184332, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '2119745', 'n_tokens_mistral': 802, 'n_tokens_neox': 787, 'n_words': 131}