<commit_before>import React, { Component } from 'react'
import AceEditor from 'react-ace'
import * as jsMode from 'brace/mode/javascript'
import * as mdMode from 'brace/mode/markdown'
import * as cssMode from 'brace/mode/css'
import * as htmlMode from 'brace/mode/html'
import * as ghTheme from 'brace/theme/github'
import _ from 'lodash'

const modes = {
  js: 'javascript',
  md: 'markdown',
  css: 'css',
  html: 'html'
}

const options = {
  lineNumbers: false,
  autofocus: false,
  tabSize: 2,
  mode: 'javascript'
}

const onLoad = (editor, onSave) => {
  window.editor = editor
  editor.commands.addCommand({
    name: 'saveChanges',
    bindKey: {win: 'Ctrl-Enter',  mac: 'Ctrl-Enter|Command-Enter'},
    exec: function(editor) {
      onSave()
    }
  });
}

export default ({files, activeFilename, onChange, onSave}) => {
  const file = _.findWhere(files, {href: activeFilename})

  if (!activeFilename || !file) return <span/>

  const mode = modes[file.filename.split('.').pop()]

  return (
    <AceEditor
      mode={mode}
      theme="github"
      name="aceEditor"
      value={file.content}
      width='100%'
      showPrintMargin={false}
      onLoad={(editor) => onLoad(editor, onSave)}
      onChange={onChange}
      editorProps={{$blockScrolling: true}}
    />
  )
}
<commit_msg>Update lodash<commit_after>import React, { Component } from 'react'
import AceEditor from 'react-ace'
import * as jsMode from 'brace/mode/javascript'
import * as mdMode from 'brace/mode/markdown'
import * as cssMode from 'brace/mode/css'
import * as htmlMode from 'brace/mode/html'
import * as ghTheme from 'brace/theme/github'
import _ from 'lodash'

const modes = {
  js: 'javascript',
  md: 'markdown',
  css: 'css',
  html: 'html'
}

const options = {
  lineNumbers: false,
  autofocus: false,
  tabSize: 2,
  mode: 'javascript'
}

const onLoad = (editor, onSave) => {
  window.editor = editor
  editor.commands.addCommand({
    name: 'saveChanges',
    bindKey: {win: 'Ctrl-Enter',  mac: 'Ctrl-Enter|Command-Enter'},
    exec: function(editor) {
      onSave()
    }
  });
}

export default ({files, activeFilename, onChange, onSave}) => {
  const file = _.find(files, {href: activeFilename})

  if (!activeFilename || !file) return <span/>

  const mode = modes[file.filename.split('.').pop()]

  return (
    <AceEditor
      mode={mode}
      theme="github"
      name="aceEditor"
      value={file.content}
      width='100%'
      showPrintMargin={false}
      onLoad={(editor) => onLoad(editor, onSave)}
      onChange={onChange}
      editorProps={{$blockScrolling: true}}
    />
  )
}

{'fraction_non_alphanumeric': 0.1514801999231065, 'fraction_numerical': 0.0030757400999615533, 'mean_word_length': 3.5017301038062283, 'pattern_counts': {'":': 0, '<': 7, '<?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': '1466398', 'n_tokens_mistral': 878, 'n_tokens_neox': 863, 'n_words': 215}