<commit_before>import React, { Component, PropTypes } from 'react';
import Highcharts from 'highcharts';

export default class Chart extends Component {
     propTypes: {
          config: PropTypes.object.isRequired,
          isPureConfig: PropTypes.bool
     };

     renderChart(config = this.props.config) {
          if (!config) {
               throw new Error('Config must be specified for the Chart component');
          }
  
          let chartConfig = config.chart;

          if (this.chart && this.props.singleSeriesChange) {
               this.chart.series[0].setData(config.series[0].data, true);
          } else {
               this.chart = new Highcharts.Chart({
                   ...config,
                   chart: {
                     ...chartConfig,
                     renderTo: this.refs.chart
                   }
               });
          }
  
     }

     shouldComponentUpdate(nextProps) {
          return !this.props.isPureConfig || !(this.props.config === nextProps.config)
     }

     componentDidUpdate() {
          this.renderChart();
     }

     getChart() {
          if (!this.chart) {
            throw new Error('getChart() should not be called before the component is mounted');
          }

          return this.chart;
     }

     componentDidMount() {
          this.renderChart();
     }

     render() {
          return <div ref="chart" />;
     }
};
<commit_msg>Indentation fixes.<commit_after>import React, { Component, PropTypes } from 'react';
import Highcharts from 'highcharts';

export default class Chart extends Component {
    propTypes: {
     config: PropTypes.object.isRequired,
     isPureConfig: PropTypes.bool
    };

    renderChart(config = this.props.config) {
        if (!config) {
            throw new Error('Config must be specified for the Chart component');
        }

        let chartConfig = config.chart;

        if (this.chart && this.props.singleSeriesChange) {
            this.chart.series[0].setData(config.series[0].data, true);
        } else {
            this.chart = new Highcharts.Chart({
                ...config,
                chart: {
                    ...chartConfig,
                    renderTo: this.refs.chart
                }
            });
        }
    }

    shouldComponentUpdate(nextProps) {
        return !this.props.isPureConfig || !(this.props.config === nextProps.config)
    }

    componentDidUpdate() {
        this.renderChart();
    }

    getChart() {
        if (!this.chart) {
            throw new Error('getChart() should not be called before the component is mounted');
        }

        return this.chart;
    }

    componentDidMount() {
        this.renderChart();
    }

    render() {
        return <div ref="chart" />;
    }
};

{'fraction_non_alphanumeric': 0.11271155923658624, 'fraction_numerical': 0.0014404033129276198, 'mean_word_length': 1.6685878962536023, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5730477', 'n_tokens_mistral': 750, 'n_tokens_neox': 721, 'n_words': 165}