<commit_before>import * as React from 'react';

import * as CodeMirror from 'codemirror';

export interface CodeComponentProps {
  code: string;
  theme: string;
}

export interface CodeComponentState {
  code: string;
}

export class CodeComponent extends React.Component<
  CodeComponentProps,
  CodeComponentState
> {
  constructor(props: CodeComponentProps) {
    super(props);
    this.state = { code: props.code };
  }

  componentWillReceiveProps(nextProps: CodeComponentProps) {
    this.setState({ code: nextProps.code });
    if (this.codeMirror) {
      this.codeMirror.refresh();
    }
  }

  componentDidMount() {
    this.codeMirror = CodeMirror.fromTextArea(
      this.refs.editor as HTMLTextAreaElement,
      {
        theme: this.props.theme,
        showCursorWhenSelecting: false,
        readOnly: 'true',
        cursorBlinkRate: -1,
        lineWrapping: true,
        scrollbarStyle: 'null'
      }
    );
    if (this.codeMirror) {
    }
  }

  render() {
    return (
      <div className="cm-toc">
        <textarea
          ref="editor"
          autoComplete="off"
          defaultValue={this.state.code}
        />
      </div>
    );
  }

  private codeMirror: CodeMirror.EditorFromTextArea | null = null;

  /* render() {
    const options = {
      theme: this.props.theme,
      showCursorWhenSelecting: false,
      readOnly: 'true',
      cursorBlinkRate: -1,
      lineWrapping: true,
      scrollbarStyle: 'null'
    };
    return (
      <CodeMirror
        className={'cm-toc'}
        value={this.state.code}
        options={options}
      />
    );
    const codeMirror = new CodeMirror.fromTe
  } */
}
<commit_msg>bug fix for dev mode<commit_after>import * as React from 'react';

import * as CodeMirror from 'codemirror';

export interface CodeComponentProps {
  code: string;
  theme: string;
}

export interface CodeComponentState {
  code: string;
}

export class CodeComponent extends React.Component<
  CodeComponentProps,
  CodeComponentState
> {
  constructor(props: CodeComponentProps) {
    super(props);
    this.state = { code: props.code };
  }

  componentWillReceiveProps(nextProps: CodeComponentProps) {
    this.setState({ code: nextProps.code });
    if (this.codeMirror) {
      this.codeMirror.refresh();
    }
  }

  componentDidMount() {
    this.codeMirror = CodeMirror.fromTextArea(
      this.refs.editor as HTMLTextAreaElement,
      {
        theme: this.props.theme,
        showCursorWhenSelecting: false,
        readOnly: 'true',
        cursorBlinkRate: -1,
        lineWrapping: true
      }
    );
    if (this.codeMirror) {
    }
  }

  render() {
    return (
      <div className="cm-toc">
        <textarea
          ref="editor"
          autoComplete="off"
          defaultValue={this.state.code}
        />
      </div>
    );
  }

  private codeMirror: CodeMirror.EditorFromTextArea | null = null;

  /* render() {
    const options = {
      theme: this.props.theme,
      showCursorWhenSelecting: false,
      readOnly: 'true',
      cursorBlinkRate: -1,
      lineWrapping: true,
      scrollbarStyle: 'null'
    };
    return (
      <CodeMirror
        className={'cm-toc'}
        value={this.state.code}
        options={options}
      />
    );
    const codeMirror = new CodeMirror.fromTe
  } */
}

{'fraction_non_alphanumeric': 0.1140430694570822, 'fraction_numerical': 0.001213224143160449, 'mean_word_length': 2.417616580310881, 'pattern_counts': {'":': 0, '<': 13, '<?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': '222285', 'n_tokens_mistral': 1037, 'n_tokens_neox': 1002, 'n_words': 204}