<commit_before>import React, { PropTypes } from 'react';
import { numberToBitset, padBitsetLeft, isNumeric } from '../utils.js';

const missileCountMax = 255;

const isValidInput = (val) => {
  return isNumeric(val) && val < missileCountMax;
};

const Missiles = ({ saveMissileCount, value }) => {
  const onChange = (ev) => {
    // What was entered in the <input /> element
    const missileCountInput = ev.target.value;
    // The count to use for updating the missile count bits
    const missileCount = isValidInput(missileCountInput) ? Number(missileCountInput) : value;

    // Convert the value to an 8-bit bitset
    const missileBitset = padBitsetLeft(numberToBitset(missileCount), 8);
    saveMissileCount(missileBitset);
  };
  return (
    <div>
      <input
        type="number"
        min={0}
        max={255}<commit_msg>Missiles can now accept max (255)<commit_after>import React, { PropTypes } from 'react';
import { numberToBitset, padBitsetLeft, isNumeric } from '../utils.js';

const missileCountMax = 255;

const isValidInput = (val) => {
  return isNumeric(val) && val <= missileCountMax;
};

const Missiles = ({ saveMissileCount, value }) => {
  const onChange = (ev) => {
    // What was entered in the <input /> element
    const missileCountInput = ev.target.value;
    // The count to use for updating the missile count bits
    const missileCount = isValidInput(missileCountInput) ? Number(missileCountInput) : value;

    // Convert the value to an 8-bit bitset
    const missileBitset = padBitsetLeft(numberToBitset(missileCount), 8);
    saveMissileCount(missileBitset);
  };
  return (
    <div>
      <input
        type="number"
        min={0}
        max={255}
{'fraction_non_alphanumeric': 0.11712772218952325, 'fraction_numerical': 0.012360211889346674, 'mean_word_length': 3.450261780104712, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, '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': '896311', 'n_tokens_mistral': 543, 'n_tokens_neox': 514, 'n_words': 146}