<commit_before>import React from 'react'

class AudioUI extends  React.Component{

  constructor(){
    super();
    this._playAudio = this._playAudio.bind(this); 
    this._togglePlay = this._togglePlay.bind(this); 
  }

  _playAudio(){
    if(this.audioPlayer.paused) {
      this.audioPlayer.play();
    } else {
      this.audioPlayer.pause();
    }
  }

  _togglePlay() {
    if(this.props.isPlaying) {
      return(
        <g>
          <rect fill="#fff" width="25.577312" height="88.712906" x="65" y="55.643555" />
          <rect fill="#fff" width="25.577312" height="88.712906" x="110" y="55.643555" />
        </g>
      )
    } else {
      return(
        <polygon points="70, 55 70, 145 145, 100" fill="#fff"/>
      )
    } 
  }

  componentDidMount() {
    this._togglePlay();
  }

  render(){
    const { isPlaying } = this.props;
    return (
      <div className='audio'>
        <button className='play-button' onClick={this._playAudio}>
          {this._togglePlay()}
          <svg className="play-icon" viewBox="0 0 200 200">
            <circle cx="100" cy="100" r="90" fill="none" strokeWidth="15" stroke="#fff"/>
            {this._togglePlay()}
          </svg>
        </button>  
        <audio ref={(audio) => {this.audioPlayer = audio}} className="audio-player" src={this.props.src}></audio>
      </div>
    )
  }
}

export default AudioUI;<commit_msg>removal of extra call to togglePlay<commit_after>import React from 'react'

class AudioUI extends  React.Component{

  constructor(){
    super();
    this._playAudio = this._playAudio.bind(this); 
    this._togglePlay = this._togglePlay.bind(this); 
  }

  _playAudio(){
    if(this.audioPlayer.paused) {
      this.audioPlayer.play();
    } else {
      this.audioPlayer.pause();
    }
  }

  _togglePlay() {
    if(this.props.isPlaying) {
      return(
        <g>
          <rect fill="#fff" width="25.577312" height="88.712906" x="65" y="55.643555" />
          <rect fill="#fff" width="25.577312" height="88.712906" x="110" y="55.643555" />
        </g>
      )
    } else {
      return(
        <polygon points="70, 55 70, 145 145, 100" fill="#fff"/>
      )
    } 
  }

  render(){
    const { isPlaying } = this.props;
    return (
      <div className='audio'>
        <button className='play-button' onClick={this._playAudio}>
          <svg className="play-icon" viewBox="0 0 200 200">
            <circle cx="100" cy="100" r="90" fill="none" strokeWidth="15" stroke="#fff"/>
            {this._togglePlay()}
          </svg>
        </button>  
        <audio ref={(audio) => {this.audioPlayer = audio}} className="audio-player" src={this.props.src}></audio>
      </div>
    )
  }
}

export default AudioUI;
{'fraction_non_alphanumeric': 0.17184035476718404, 'fraction_numerical': 0.06356245380635625, 'mean_word_length': 2.392230576441103, 'pattern_counts': {'":': 0, '<': 31, '<?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': '1369945', 'n_tokens_mistral': 1024, 'n_tokens_neox': 890, 'n_words': 171}