<commit_before>import React from 'react';
import PropTypes from 'prop-types';
import Draggable from 'react-draggable';
import cs from 'classnames';

import '../css/Resizeable';


class Resizeable extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      dragging: false,
    };
    this.dragStart = this.dragStart.bind(this);
    this.dragStop = this.dragStop.bind(this);
  }

  static propTypes = {
    children: PropTypes.arrayOf(PropTypes.node).isRequired,
    barSize: PropTypes.number,
    axis: PropTypes.oneOf(['x', 'y']),
    onResize: PropTypes.func,
  };

  dragStart(e, dragData) {
    if (!this.state.dragging) {
      this.setState({ dragging: true });
    }
  }
  dragStop(e, dragData) {
    if (this.state.dragging) {
      this.setState({ dragging: false });
    }
    if (typeof this.props.onResize === 'function') {
      this.props.onResize(e, dragData);
    }
  }

  render() {
    const { children, barSize = 5, axis = 'x', onResize, ...rest } = this.props;
    if (children.length !== 2) {
      throw new Error('Resizeable: unsupported children length');
    }
    const content = [];
    children.forEach((child, i) => {
      content.push(child);
      if (i % 2 === 0) {
        content.push(
          <Draggable
            axis={axis}
            onStart={this.dragStart}
            onStop={this.dragStop}
            bounds='parent'
            position={{ x: 0, y: 0 }}
            >
            <div className={`resizeable-bar resizeable-bar-${axis}`}>
              <div className='resizeable-bar-child' style={{ [axis === 'x' ? 'width' : 'height']: barSize }} />
            </div>
          </Draggable>
        );
      }
    });
    if (this.state.dragging) {
      content.push(<div className='resizeable-backdrop' />);
    }
    return React.createElement('div', {
      ...rest,
      className: cs('resizeable', `resizeable-${axis}`, rest.className),
    }, ...content);
  }
}

export default Resizeable;
<commit_msg>resolve `no-unused-vars` violation<commit_after>import React from 'react';
import PropTypes from 'prop-types';
import Draggable from 'react-draggable';
import cs from 'classnames';

import '../css/Resizeable';


class Resizeable extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      dragging: false,
    };
    this.dragStart = this.dragStart.bind(this);
    this.dragStop = this.dragStop.bind(this);
  }

  static propTypes = {
    children: PropTypes.arrayOf(PropTypes.node).isRequired,
    barSize: PropTypes.number,
    axis: PropTypes.oneOf(['x', 'y']),
    onResize: PropTypes.func,
  };

  dragStart(e, dragData) {
    if (!this.state.dragging) {
      this.setState({ dragging: true });
    }
  }
  dragStop(e, dragData) {
    if (this.state.dragging) {
      this.setState({ dragging: false });
    }
    if (typeof this.props.onResize === 'function') {
      this.props.onResize(e, dragData);
    }
  }

  render() {
    // eslint-disable-next-line no-unused-vars
    const { children, barSize = 5, axis = 'x', onResize, ...rest } = this.props;

    if (children.length !== 2) {
      throw new Error('Resizeable: unsupported children length');
    }
    const content = [];
    children.forEach((child, i) => {
      content.push(child);
      if (i % 2 === 0) {
        content.push(
          <Draggable
            axis={axis}
            onStart={this.dragStart}
            onStop={this.dragStop}
            bounds='parent'
            position={{ x: 0, y: 0 }}
            >
            <div className={`resizeable-bar resizeable-bar-${axis}`}>
              <div className='resizeable-bar-child' style={{ [axis === 'x' ? 'width' : 'height']: barSize }} />
            </div>
          </Draggable>
        );
      }
    });
    if (this.state.dragging) {
      content.push(<div className='resizeable-backdrop' />);
    }
    return React.createElement('div', {
      ...rest,
      className: cs('resizeable', `resizeable-${axis}`, rest.className),
    }, ...content);
  }
}

export default Resizeable;

{'fraction_non_alphanumeric': 0.1620221948212084, 'fraction_numerical': 0.002959309494451295, 'mean_word_length': 2.3969849246231156, 'pattern_counts': {'":': 0, '<': 15, '<?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': '6620171', 'n_tokens_mistral': 1292, 'n_tokens_neox': 1294, 'n_words': 262}