<commit_before>import React from 'react'
import PropTypes from 'prop-types'
import { cloneDeep } from 'lodash'

import { withStyles } from 'material-ui/styles'
import Button from 'material-ui/Button'
import IconButton from 'material-ui/IconButton'
import TextField from 'material-ui/TextField'
import Typography from 'material-ui/Typography'
import ContentRemoveCircle from 'material-ui-icons/RemoveCircle'
import ContentAddCircle from 'material-ui-icons/AddCircle'

import RatingField from '../../generic/ratingField.jsx'
import { ABILITY_MAX as MAX, ABILITY_MIN as MIN } from '../../../utils/constants.js'
import { withIntimacies } from '../../../utils/propTypes'

const styles = theme => ({
  fieldContainer: {
    display: 'flex',
    alignItems: 'center',
  },
  nameField: {
    flex: 1,
    marginRight: theme.spacing.unit,
  },
})

function _ResourceFields(props) {
  const { onResourcesChange, onResourcesBlur, onValueChange, onRemove, classes } = props
  const { resource, value } = props.resource

  return <div className={ classes.fieldContainer }>
    <TextField name="resource" value={ resource } className={ classes.nameField }
      label="Resource" margin="dense"
      onChange={ onResourcesChange } onBlur={ onResourcesBlur }
    />
    <RatingField trait="value" value={ value }
      label="Value" min={ MIN } max={ MAX } margin="dense" narrow
      onChange={ onValueChange }
    />
    <IconButton onClick={ onRemove }><ContentRemoveCircle /></IconButton>
  </div>
}
_ResourceFields.propTypes = {
  resource: PropTypes.object,
  onResourcesChange: PropTypes.func,
  onResourcesBlur: PropTypes.func,
  onValueChange: PropTypes.func,
  onRemove: PropTypes.func,
  classes: PropTypes.object,
}
const ResourceFields = withStyles(styles)(_ResourceFields)

class ResourceEditor extends React.Component {
  constructor(props) {<commit_msg>Fix resources editor clamping at 5<commit_after>import React from 'react'
import PropTypes from 'prop-types'
import { cloneDeep } from 'lodash'

import { withStyles } from 'material-ui/styles'
import Button from 'material-ui/Button'
import IconButton from 'material-ui/IconButton'
import TextField from 'material-ui/TextField'
import Typography from 'material-ui/Typography'
import ContentRemoveCircle from 'material-ui-icons/RemoveCircle'
import ContentAddCircle from 'material-ui-icons/AddCircle'

import RatingField from '../../generic/ratingField.jsx'
import { withIntimacies } from '../../../utils/propTypes'

const styles = theme => ({
  fieldContainer: {
    display: 'flex',
    alignItems: 'center',
  },
  nameField: {
    flex: 1,
    marginRight: theme.spacing.unit,
  },
})

function _ResourceFields(props) {
  const { onResourcesChange, onResourcesBlur, onValueChange, onRemove, classes } = props
  const { resource, value } = props.resource

  return <div className={ classes.fieldContainer }>
    <TextField name="resource" value={ resource } className={ classes.nameField }
      label="Resource" margin="dense"
      onChange={ onResourcesChange } onBlur={ onResourcesBlur }
    />
    <RatingField trait="value" value={ value }
      label="Value" min={ 0 } margin="dense" narrow
      onChange={ onValueChange }
    />
    <IconButton onClick={ onRemove }><ContentRemoveCircle /></IconButton>
  </div>
}
_ResourceFields.propTypes = {
  resource: PropTypes.object,
  onResourcesChange: PropTypes.func,
  onResourcesBlur: PropTypes.func,
  onValueChange: PropTypes.func,
  onRemove: PropTypes.func,
  classes: PropTypes.object,
}
const ResourceFields = withStyles(styles)(_ResourceFields)

class ResourceEditor extends React.Component {
  constructor(props) {
{'fraction_non_alphanumeric': 0.12142070484581498, 'fraction_numerical': 0.0011013215859030838, 'mean_word_length': 4.512898330804249, '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': '2561454', 'n_tokens_mistral': 1048, 'n_tokens_neox': 1055, 'n_words': 272}