<commit_before>import React, { Component } from 'react'
import StepButton from './StepButton'

class Home extends Component {
  constructor(props) {
    super(props)

    this.state = {
      stepButtonStates: new Array(16).fill(false)
    }

    this.saveBeat = this.saveBeat.bind(this)
    this.toggle = this.toggle.bind(this)
  }

  toggle(index) {
    const temp = this.state.stepButtonStates.slice()
    temp[index] = !temp[index]
    this.setState({stepButtonStates: temp})
  }

  saveBeat() {
    console.log('beat pattern: ', this.state.stepButtonStates)
  }

  render() {
    const saveBtnStyle = {
      background: '#c0c',
      height: '40px',
      width: '40px',
      display: 'inline-block',
      margin: '10px'
    }

    const buttons = this.state.stepButtonStates.map((selected, i) => {
      return (
        <StepButton
          isSelected={this.state.stepButtonStates[i]}
          toggle={this.toggle}
          key={'btn'+i}
          index={i}
        />
      )
    })

    return (
      <div >
        <h1>drum machine</h1>
        {buttons}
        <span style={saveBtnStyle} onClick={ this.saveBeat }>SAVE</span>

      </div><commit_msg>change colors<commit_after>import React, { Component } from 'react'
import StepButton from './StepButton'

class Home extends Component {
  constructor(props) {
    super(props)

    this.state = {
      stepButtonStates: new Array(16).fill(false)
    }

    this.saveBeat = this.saveBeat.bind(this)
    this.toggle = this.toggle.bind(this)
  }

  toggle(index) {
    const temp = this.state.stepButtonStates.slice()
    temp[index] = !temp[index]
    this.setState({stepButtonStates: temp})
  }

  saveBeat() {
    console.log('beat pattern: ', this.state.stepButtonStates)
  }

  render() {
    const saveBtnStyle = {
      background: '#aae',
      height: '40px',
      width: '40px',
      display: 'inline-block',
      margin: '10px'
    }

    const buttons = this.state.stepButtonStates.map((selected, i) => {
      return (
        <StepButton
          isSelected={this.state.stepButtonStates[i]}
          toggle={this.toggle}
          key={'btn'+i}
          index={i}
        />
      )
    })

    return (
      <div >
        <h1>drum machine</h1>
        {buttons}
        <span style={saveBtnStyle} onClick={ this.saveBeat }>SAVE</span>

      </div>
{'fraction_non_alphanumeric': 0.14188034188034188, 'fraction_numerical': 0.008974358974358974, 'mean_word_length': 2.373198847262248, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 19, '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': '6851141', 'n_tokens_mistral': 772, 'n_tokens_neox': 743, 'n_words': 138}