<commit_before>'use strict'

/**
 * This program handles spawning of creeps.
 */
class Spawns extends kernel.process {
  constructor (...args) {
    super(...args)
    this.priority = PRIORITIES_SPAWNS
  }

  getDescriptor () {
    return this.data.room
  }

  main () {
    if (!Game.rooms[this.data.room]) {
      return this.suicide()
    }
    this.room = Game.rooms[this.data.room]
    const spawns = this.room.find(FIND_MY_SPAWNS, {filter: (a)}=>a.isActive()})

    let spawn
    for (spawn of spawns) {
      if (spawn.spawning) {
        continue
      }
      const creep = this.room.getQueuedCreep()
      if (!creep) {
        break
      }
      const ret = spawn.createCreep(creep.build, creep.name, creep.memory)
      if (Number.isInteger(ret)) {
        Logger.log(`Error ${ret} while spawning creep ${creep.name} in room ${this.data.room}`, LOG_ERROR)
      } else {
        Logger.log(`Spawning creep ${creep.name} from ${this.data.room}`)
      }
    }
  }
}

module.exports = Spawns
<commit_msg>syntax... grr...<commit_after>'use strict'

/**
 * This program handles spawning of creeps.
 */
class Spawns extends kernel.process {
  constructor (...args) {
    super(...args)
    this.priority = PRIORITIES_SPAWNS
  }

  getDescriptor () {
    return this.data.room
  }

  main () {
    if (!Game.rooms[this.data.room]) {
      return this.suicide()
    }
    this.room = Game.rooms[this.data.room]
    const spawns = this.room.find(FIND_MY_SPAWNS, {filter: s=>s.isActive()})

    let spawn
    for (spawn of spawns) {
      if (spawn.spawning) {
        continue
      }
      const creep = this.room.getQueuedCreep()
      if (!creep) {
        break
      }
      const ret = spawn.createCreep(creep.build, creep.name, creep.memory)
      if (Number.isInteger(ret)) {
        Logger.log(`Error ${ret} while spawning creep ${creep.name} in room ${this.data.room}`, LOG_ERROR)
      } else {
        Logger.log(`Spawning creep ${creep.name} from ${this.data.room}`)
      }
    }
  }
}

module.exports = Spawns

{'fraction_non_alphanumeric': 0.14630541871921182, 'fraction_numerical': 0.0, 'mean_word_length': 2.3963210702341136, 'pattern_counts': {'":': 0, '<': 3, '<?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': '80149', 'n_tokens_mistral': 716, 'n_tokens_neox': 698, 'n_words': 145}