<commit_before>import React, { Component, Children, PropTypes, createElement, cloneElement } from 'react'
import ReactDOM from 'react-dom'
import shallowCompare from 'react/lib/shallowCompare'
import getNodeDimensions from './get-node-dimensions'

// TODO:
// handle prop change on MutationObserver config, should disconnect and reconnect with new config
// handle prop change for whitelist/blacklist

class Measure extends Component {
  static propTypes = {
    config: PropTypes.object,
    accurate: PropTypes.bool,
    whitelist: PropTypes.array,
    blacklist: PropTypes.array,
    onMeasure: PropTypes.func,
    shouldMeasure: PropTypes.func
  }

  static defaultProps = {
    config: {
      childList: true
    },
    accurate: false,
    whitelist: ['width', 'height', 'top', 'right', 'bottom', 'left'],
    blacklist: [],
    onMeasure: () => null,
    shouldMeasure: () => true
  }

  _whitelist = this.props.whitelist
  _properties = this._whitelist.filter(prop => this.props.blacklist.indexOf(prop) < 0)
  _observer = null
  _node = null
  _lastDimensions = {}

  componentDidMount() {
    this._node = ReactDOM.findDOMNode(this)

    // set up mutation observer
    this._observer = new MutationObserver(this._onMutation)
    this._observer.observe(this._node, this.props.config)

    // fire callback for first render
    this.getDimensions()
  }

  shouldComponentUpdate(nextProps, nextState) {
    return shallowCompare(this, nextProps, nextState)
  }

  componentWillUnmount() {
    this._observer.disconnect()
  }
<commit_msg>cleaned up prop order because I have OCD<commit_after>import React, { Component, Children, PropTypes, createElement, cloneElement } from 'react'
import ReactDOM from 'react-dom'
import shallowCompare from 'react/lib/shallowCompare'
import getNodeDimensions from './get-node-dimensions'

// TODO:
// handle prop change on MutationObserver config, should disconnect and reconnect with new config
// handle prop change for whitelist/blacklist

class Measure extends Component {
  static propTypes = {
    config: PropTypes.object,
    accurate: PropTypes.bool,
    whitelist: PropTypes.array,
    blacklist: PropTypes.array,
    shouldMeasure: PropTypes.func,
    onMeasure: PropTypes.func
  }

  static defaultProps = {
    config: {
      childList: true
    },
    accurate: false,
    whitelist: ['width', 'height', 'top', 'right', 'bottom', 'left'],
    blacklist: [],
    shouldMeasure: () => true,
    onMeasure: () => null
  }

  _whitelist = this.props.whitelist
  _properties = this._whitelist.filter(prop => this.props.blacklist.indexOf(prop) < 0)
  _observer = null
  _node = null
  _lastDimensions = {}

  componentDidMount() {
    this._node = ReactDOM.findDOMNode(this)

    // set up mutation observer
    this._observer = new MutationObserver(this._onMutation)
    this._observer.observe(this._node, this.props.config)

    // fire callback for first render
    this.getDimensions()
  }

  shouldComponentUpdate(nextProps, nextState) {
    return shallowCompare(this, nextProps, nextState)
  }

  componentWillUnmount() {
    this._observer.disconnect()
  }

{'fraction_non_alphanumeric': 0.10779595765158806, 'fraction_numerical': 0.0006416426050689766, 'mean_word_length': 3.767584097859327, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '1626269', 'n_tokens_mistral': 934, 'n_tokens_neox': 918, 'n_words': 235}