<commit_before>package colossus

import akka.util.Timeout
import colossus.core.Worker.ConnectionSummary

import core._

import akka.actor._
import metrics._
import task._

import java.net.InetSocketAddress

import scala.concurrent.{ExecutionContext, Future}

object IOSystem {

  def apply(config: IOSystemConfig, metrics: MetricSystem)(implicit system: ActorSystem): IOSystem = {
    val workerManager = system.actorOf(Props(classOf[WorkerManager], WorkerManagerConfig(config.numWorkers, metrics)), name = s"${config.name}-manager")
    val sys = IOSystem(workerManager, config, metrics, system)
    workerManager ! WorkerManager.Initialize(sys)
    sys
  }

  def apply(name: String, numWorkers: Int, metrics: MetricSystem)
    (implicit system: ActorSystem): IOSystem = apply(IOSystemConfig(name, numWorkers), metrics)


  def apply(name: String, numWorkers: Int)(implicit system: ActorSystem): IOSystem = apply(name, numWorkers, MetricSystem.deadSystem)

  def apply(name: String = "iosystem", numWorkers: Option[Int] = None)(implicit sys: ActorSystem = ActorSystem(name)): IOSystem = {
    val workers = numWorkers.getOrElse (Runtime.getRuntime.availableProcessors())
    val metrics = MetricSystem(MetricAddress.Root / name)
    apply(name, workers, metrics)
  }
<commit_msg>add a new IOSystem constructor<commit_after>package colossus

import akka.util.Timeout
import colossus.core.Worker.ConnectionSummary

import core._

import akka.actor._
import metrics._
import task._

import java.net.InetSocketAddress

import scala.concurrent.{ExecutionContext, Future}

object IOSystem {

  def apply(config: IOSystemConfig, metrics: MetricSystem)(implicit system: ActorSystem): IOSystem = {
    val workerManager = system.actorOf(Props(classOf[WorkerManager], WorkerManagerConfig(config.numWorkers, metrics)), name = s"${config.name}-manager")
    val sys = IOSystem(workerManager, config, metrics, system)
    workerManager ! WorkerManager.Initialize(sys)
    sys
  }

  def apply(name: String, numWorkers: Int, metrics: MetricSystem)
    (implicit system: ActorSystem): IOSystem = apply(IOSystemConfig(name, numWorkers), metrics)


  def apply(name: String, numWorkers: Int)(implicit system: ActorSystem): IOSystem = apply(name, numWorkers, MetricSystem.deadSystem)

  def apply(name: String, metrics: MetricSystem)(implicit  system: ActorSystem): IOSystem = {
    val numWorkers = Runtime.getRuntime.availableProcessors()
    apply(name, numWorkers, metrics)
  }

  def apply(name: String = "iosystem", numWorkers: Option[Int] = None)(implicit sys: ActorSystem = ActorSystem(name)): IOSystem = {
    val workers = numWorkers.getOrElse (Runtime.getRuntime.availableProcessors())
    val metrics = MetricSystem(MetricAddress.Root / name)
    apply(name, workers, metrics)
  }

{'fraction_non_alphanumeric': 0.10550954267194815, 'fraction_numerical': 0.0, 'mean_word_length': 5.598574821852732, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1456355', 'n_tokens_mistral': 830, 'n_tokens_neox': 827, 'n_words': 202}