<commit_before>import React, { Component } from 'react';
import { Range } from 'immutable';
import styles from './Pagination.module.scss';

export default class Pagination extends Component {

  constructor() {
    super();
    this.handleClick = this.handleClick.bind(this);
    this.nextPage = this.nextPage.bind(this);
    this.previousPage = this.previousPage.bind(this);
  }

  nextPage() {
    const nextPageDisabled = this.props.currentPage >= this.props.totalPages;
    if (!nextPageDisabled) {
      this.props.onChangePage(this.props.currentPage + 1);
    }
  }

  previousPage() {
    const previousPageDisabled = this.props.currentPage <= 1;
    if (!previousPageDisabled) {
      this.props.onChangePage(this.props.currentPage - 1);
    }
  }

  handleClick(event) {
    event.preventDefault();
    const nextPage = parseInt(event.target.getAttribute('data-page-number'));
    this.props.onChangePage(nextPage)
  }

  renderPaginationButton(page) {
    const className = (page === this.props.currentPage ? styles.activeButton : styles.button);
    return (
      <li key={page} className={styles.item}>
        <a className={className} data-page-number={page} onClick={this.handleClick} href="#">
          {page}
        </a>
      </li>
    );
  }


  render() {
    const start = Math.max(1, this.props.currentPage - 4);
    const end = Math.min(this.props.totalPages + 1, this.props.currentPage + 5);
    const range = Range(start, Math.max(end, Math.min(10, this.props.totalPages)));
    const paginationButtons = range.map(this.renderPaginationButton.bind(this));

    return (
      <ul className={styles.list}>
        <li className={styles.item}>
          <a href="#" className={styles.button}  onClick={this.previousPage}>&lt;</a>
        </li>
        {paginationButtons}
        <li className={styles.item}>
          <a href="#" className={styles.button} onClick={this.nextPage}>&gt;</a>
        </li>
      </ul>
    );
  }
}<commit_msg>Fix lint issues<commit_after>import React, { Component } from 'react';
import { Range } from 'immutable';
import styles from './Pagination.module.scss';

export default class Pagination extends Component {

  constructor() {
    super();
    this.handleClick = this.handleClick.bind(this);
    this.nextPage = this.nextPage.bind(this);
    this.previousPage = this.previousPage.bind(this);
  }

  nextPage() {
    const nextPageDisabled = this.props.currentPage >= this.props.totalPages;
    if (!nextPageDisabled) {
      this.props.onChangePage(this.props.currentPage + 1);
    }
  }

  previousPage() {
    const previousPageDisabled = this.props.currentPage <= 1;
    if (!previousPageDisabled) {
      this.props.onChangePage(this.props.currentPage - 1);
    }
  }

  handleClick(event) {
    event.preventDefault();
    const nextPage = parseInt(event.target.getAttribute('data-page-number'), 10);
    this.props.onChangePage(nextPage)
  }

  renderPaginationButton(page) {
    const className = (page === this.props.currentPage ? styles.activeButton : styles.button);
    return (
      <li key={page} className={styles.item}>
        <a className={className} data-page-number={page} onClick={this.handleClick} href="#">
          {page}
        </a>
      </li>
    );
  }


  render() {
    const start = Math.max(1, this.props.currentPage - 4);
    const end = Math.min(this.props.totalPages + 1, this.props.currentPage + 5);
    const range = new Range(start, Math.max(end, Math.min(10, this.props.totalPages)));
    const paginationButtons = range.map(this.renderPaginationButton.bind(this));

    return (
      <ul className={styles.list}>
        <li className={styles.item}>
          <a href="#" className={styles.button} onClick={this.previousPage}>&lt;</a>
        </li>
        {paginationButtons}
        <li className={styles.item}>
          <a href="#" className={styles.button} onClick={this.nextPage}>&gt;</a>
        </li>
      </ul>
    );
  }
}
{'fraction_non_alphanumeric': 0.15105356689515106, 'fraction_numerical': 0.005077430820005078, 'mean_word_length': 3.1473684210526316, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, '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': '3213670', 'n_tokens_mistral': 1228, 'n_tokens_neox': 1209, 'n_words': 224}