<commit_before>var _ = require('lodash')                               // import _ from 'lodash'
var util = require('../util')                           // import util from '../util'
var taskTypes = require('../constants/task-type')       // import * as taskTypes from '../constants/task-type'

// task definition function
var writer = function(path) {
  return {
    type: taskTypes.TASK_TYPE_WRITE,
    params: {
      path
    }
  }
}

write.fromJSON = function(json) {
  var params = _.get(json, 'params', {})
  var path = JSON.stringify(params.path) || '""'
  return 'write(' + path + ')'
}

module.exports = writer   // export default list
<commit_msg>Added write.fromJSON().<commit_after>var _ = require('lodash')                               // import _ from 'lodash'
var util = require('../util')                           // import util from '../util'
var taskTypes = require('../constants/task-type')       // import * as taskTypes from '../constants/task-type'

// task definition function
var write = function(path) {
  return {
    type: taskTypes.TASK_TYPE_WRITE,
    params: {
      path
    }
  }
}

write.fromJSON = function(json) {
  var params = _.get(json, 'params', {})
  var path = JSON.stringify(params.path) || '""'
  return 'write(' + path + ')'
}

module.exports = write   // export default list

{'fraction_non_alphanumeric': 0.1555891238670695, 'fraction_numerical': 0.0, 'mean_word_length': 2.2004830917874396, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7274706', 'n_tokens_mistral': 392, 'n_tokens_neox': 393, 'n_words': 97}