<commit_before>package almhirt.common

trait HasExecutionContext {
  def executionContext: scala.concurrent.ExecutionContext
}

object HasExecutionContext {
  import java.util.concurrent._
  def apply(): HasExecutionContext = cached

  def cached(): HasExecutionContext = new HasExecutionContext {
    val executionContext = scala.concurrent.ExecutionContext.fromExecutor(Executors.newCachedThreadPool())
  }
  
  def single(): HasExecutionContext = new HasExecutionContext {
    val executionContext = scala.concurrent.ExecutionContext.fromExecutor(Executors.newSingleThreadExecutor())
  }
  
  def fixed(nThreads: Int): HasExecutionContext = new HasExecutionContext {
    val executionContext = scala.concurrent.ExecutionContext.fromExecutor(Executors.newFixedThreadPool(nThreads))
  }
}<commit_msg>Added more traits for HasExecutionContext with defaults<commit_after>package almhirt.common

trait HasExecutionContext {
  def executionContext: scala.concurrent.ExecutionContext
}

import java.util.concurrent._

trait HasCachedExecutionContext extends HasExecutionContext {
  val executionContext = scala.concurrent.ExecutionContext.fromExecutor(Executors.newCachedThreadPool())
}

trait HasSingleThreadedExecutionContext extends HasExecutionContext {
  val executionContext = scala.concurrent.ExecutionContext.fromExecutor(Executors.newSingleThreadExecutor())
}

trait HasFixedSizeExecutionContext extends HasExecutionContext {
  def nThreads: Int
  val executionContext = scala.concurrent.ExecutionContext.fromExecutor(Executors.newFixedThreadPool(nThreads))
}

object HasExecutionContext {
  def apply(): HasExecutionContext = cached

  def cached(): HasExecutionContext = new HasExecutionContext {
    val executionContext = scala.concurrent.ExecutionContext.fromExecutor(Executors.newCachedThreadPool())
  }

  def single(): HasExecutionContext = new HasExecutionContext {
    val executionContext = scala.concurrent.ExecutionContext.fromExecutor(Executors.newSingleThreadExecutor())
  }

  def fixed(nThreads: Int): HasExecutionContext = new HasExecutionContext {
    val executionContext = scala.concurrent.ExecutionContext.fromExecutor(Executors.newFixedThreadPool(nThreads))
  }
}
{'fraction_non_alphanumeric': 0.07393884071200366, 'fraction_numerical': 0.0, 'mean_word_length': 6.71830985915493, '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': '7392874', 'n_tokens_mistral': 519, 'n_tokens_neox': 552, 'n_words': 110}