<commit_before>;(function () {
  var root = this
  var prevCHR
  if (root && root.CHR) {
    prevCHR = root.CHR
  }

  var Runtime = require('../runtime')
  var Rules = require('./rules')
  var joinParts = require('./join-parts')

  var parse
  if (process.env.NODE_ENV === 'browserWithoutParser') {
    parse = root.parseCHR
  } else {
    parse = require('./parser').parse
  }

  function CHR (opts) {
    opts = opts || {}
    opts.store = opts.store || new Runtime.Store()
    opts.history = opts.history || new Runtime.History()
    opts.rules = opts.rules || new Rules(tag)
    opts.scope = opts.scope || {}

    /**
     * Adds a number of rules given.
     */
    function tag (chrSource) {
      var program
      var replacements

      // Examine caller format
      if (typeof chrSource === 'object' && chrSource.type && chrSource.type === 'Program') {
        // called with already parsed source code
        // e.g. tag({ type: 'Program', body: [ ... ] })
        program = chrSource
        replacements = []

        // allow to specify replacements as second argument
        if (arguments[1] && typeof arguments[1] === 'object' && arguments[1] instanceof Array) {
          replacements = arguments[1]
        }
      } else if (typeof chrSource === 'object' && chrSource instanceof Array && typeof chrSource[0] === 'string') {
        // called as template tag
        // e.g. tag`a ==> b`
        // or   tag`a ==> ${ function() { console.log('Replacement test') } }`
        var combined = [ chrSource[0]]<commit_msg>Use JavaScript Standard Style 5.0<commit_after>;(function () {
  var root = this
  var prevCHR
  if (root && root.CHR) {
    prevCHR = root.CHR
  }

  var Runtime = require('../runtime')
  var Rules = require('./rules')
  var joinParts = require('./join-parts')

  var parse
  if (process.env.NODE_ENV === 'browserWithoutParser') {
    parse = root.parseCHR
  } else {
    parse = require('./parser').parse
  }

  function CHR (opts) {
    opts = opts || {}
    opts.store = opts.store || new Runtime.Store()
    opts.history = opts.history || new Runtime.History()
    opts.rules = opts.rules || new Rules(tag)
    opts.scope = opts.scope || {}

    /**
     * Adds a number of rules given.
     */
    function tag (chrSource) {
      var program
      var replacements

      // Examine caller format
      if (typeof chrSource === 'object' && chrSource.type && chrSource.type === 'Program') {
        // called with already parsed source code
        // e.g. tag({ type: 'Program', body: [ ... ] })
        program = chrSource
        replacements = []

        // allow to specify replacements as second argument
        if (arguments[1] && typeof arguments[1] === 'object' && arguments[1] instanceof Array) {
          replacements = arguments[1]
        }
      } else if (typeof chrSource === 'object' && chrSource instanceof Array && typeof chrSource[0] === 'string') {
        // called as template tag
        // e.g. tag`a ==> b`
        // or   tag`a ==> ${ function() { console.log('Replacement test') } }`
        var combined = [ chrSource[0] ]
{'fraction_non_alphanumeric': 0.1526298806066473, 'fraction_numerical': 0.00451758631816715, 'mean_word_length': 2.3155080213903743, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '1297687', 'n_tokens_mistral': 917, 'n_tokens_neox': 899, 'n_words': 261}