<commit_before>import React from 'react';

const boxStyle = {
  display: 'flex',
  flexDirection: 'row',
  flexWrap: 'nowrap',
  justifyContent: 'space-between',
  alignContent: 'space-between',
  alignItems: 'stretch'
};

const itemStyle = {
  boxSizing: 'border-box'
};

function mixBoxProps(style, props) {
  const divStyle = {};

  if (props.row) {
    divStyle.flexDirection = 'row';
    divStyle.alignItems = 'center';
  } else if (props.column) {
    divStyle.flexDirection = 'column';
  }

  if (props.wrap) {
    divStyle.flexWrap = 'wrap';
  }

  if (props.justifyStart) {
    divStyle.justifyContent = "flex-start";
  } else if (props.justifyEnd) {
    divStyle.justifyContent = "flex-end";
  } else if (props.justifyCenter) {
    divStyle.justifyContent = "center";
  } else if (props.justifySpaceBetween) {
    divStyle.justifyContent = "space-between";
  } else if (props.justifySpaceAround) {
    divStyle.justifyContent = "space-around";
  }

  if (props.alignStart) {
    divStyle.alignItems = "flex-start";
  } else if (props.alignEnd) {
    divStyle.alignItems = "flex-end";
  } else if (props.alignCenter) {
    divStyle.alignItems = "center";
  } else if (props.alignStretch) {
    divStyle.alignItems = "stretch";
  } else if (props.alignBaseline) {
    divStyle.alignItems = "baseline";
  }

  return Object.assign({}, boxStyle, divStyle, style);
}

function mixItemProps(style, props) {
  const divStyle = {};

  if (typeof props.size === 'number') {
    divStyle.flexGrow = props.size;
    divStyle.flexShrink = 0;
    divStyle.flexBasis = 0;
  } else {
    divStyle.flexBasis = 'auto';
    divStyle.flexGrow = 0;
    divStyle.flexShrink = 0;
  }

  return Object.assign({}, itemStyle, divStyle, style);
}

function cleanProps(props) {
  const result = Object.assign({}, props);
  delete result["style"];
  delete result["item"];
  delete result["box"];
  delete result["row"];
  delete result["column"];
  delete result["wrap"];
  delete result["justifyStart"];
  delete result["justifyEnd"];
  delete result["justifyCenter"];
  delete result["justifySpaceBetween"];
  delete result["justifySpaceAround"];
  delete result["alignStart"];
  delete result["alignEnd"];
  delete result["alignCenter"];
  delete result["alignStretch"];
  delete result["alignBaseline"];
  return result;
}

export default class View extends React.Component {
  render() {
    const { style, item, box } = this.props;
    const composedStyle = Object.assign({},
      item ? mixItemProps(style, this.props) : {},
      box ? mixBoxProps(style, this.props) : {});
    const props = cleanProps(this.props);

    return <div { ...props } style={ composedStyle }>{this.props.children}</div>;
  }
}
<commit_msg>Update code to pass ESLint checks<commit_after>import React from 'react';

const boxStyle = {
  display: 'flex',
  flexDirection: 'row',
  flexWrap: 'nowrap',
  justifyContent: 'space-between',
  alignContent: 'space-between',
  alignItems: 'stretch'
};

const itemStyle = {
  boxSizing: 'border-box'
};

function mixBoxProps(style, props) {
  const divStyle = {};

  if (props.row) {
    divStyle.flexDirection = 'row';
    divStyle.alignItems = 'center';
  } else if (props.column) {
    divStyle.flexDirection = 'column';
  }

  if (props.wrap) {
    divStyle.flexWrap = 'wrap';
  }

  if (props.justifyStart) {
    divStyle.justifyContent = 'flex-start';
  } else if (props.justifyEnd) {
    divStyle.justifyContent = 'flex-end';
  } else if (props.justifyCenter) {
    divStyle.justifyContent = 'center';
  } else if (props.justifySpaceBetween) {
    divStyle.justifyContent = 'space-between';
  } else if (props.justifySpaceAround) {
    divStyle.justifyContent = 'space-around';
  }

  if (props.alignStart) {
    divStyle.alignItems = 'flex-start';
  } else if (props.alignEnd) {
    divStyle.alignItems = 'flex-end';
  } else if (props.alignCenter) {
    divStyle.alignItems = 'center';
  } else if (props.alignStretch) {
    divStyle.alignItems = 'stretch';
  } else if (props.alignBaseline) {
    divStyle.alignItems = 'baseline';
  }

  return Object.assign({}, boxStyle, divStyle, style);
}

function mixItemProps(style, props) {
  const divStyle = {};

  if (typeof props.size === 'number') {
    divStyle.flexGrow = props.size;
    divStyle.flexShrink = 0;
    divStyle.flexBasis = 0;
  } else {
    divStyle.flexBasis = 'auto';
    divStyle.flexGrow = 0;
    divStyle.flexShrink = 0;
  }

  return Object.assign({}, itemStyle, divStyle, style);
}

function cleanProps(props) {
  const result = Object.assign({}, props);
  [
    'style',
    'item',
    'box',
    'row',
    'column',
    'wrap',
    'justifyStart',
    'justifyEnd',
    'justifyCenter',
    'justifySpaceBetween',
    'justifySpaceAround',
    'alignStart',
    'alignEnd',
    'alignCenter',
    'alignStretch',
    'alignBaseline'
  ].forEach(prop => delete result[prop]);
  return result;
}

class View extends React.Component {
  render() {
    const {style, item, box} = this.props;
    const composedStyle = Object.assign({},
      item ? mixItemProps(style, this.props) : {},
      box ? mixBoxProps(style, this.props) : {});
    const props = cleanProps(this.props);

    return <div {...props} style={composedStyle}>{this.props.children}</div>;
  }
}

View.propTypes = {
  style: React.PropTypes.object,
  item: React.PropTypes.any,
  box: React.PropTypes.any,
  children: React.PropTypes.node
  // TODO: add all possible props here
};

export default View;

{'fraction_non_alphanumeric': 0.14960629921259844, 'fraction_numerical': 0.0014649331624244644, 'mean_word_length': 3.593776282590412, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 8, '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': '7338610', 'n_tokens_mistral': 1847, 'n_tokens_neox': 1806, 'n_words': 390}