<commit_before>package scala.concurrent;

module ops {

  def spawn(def p: Unit) = {
    val t = new Thread { override def run() = p; }
    t.run()
  }

  def future[a](def p: a): () => a = {
    val result = new SyncVar[a];
    spawn { result set p }
    () => result.get
  }

  def par[a, b](def xp: a, def yp: b): Pair[a, b] = {
    val y = new SyncVar[b];
    spawn { y set yp }
    Pair(xp, y.get)
  }

  def replicate(start: Int, end: Int)(def p: Int => Unit): Unit = {
    if (start == end) {
    } else if (start + 1 == end) {
      p(start)
    } else {
      val mid = (start + end) / 2;
      spawn { replicate(start, mid)(p) }
      replicate(mid, end)(p)
    }
  }

  def parMap[a,b](f: a => b, xs: Array[a]): Array[b] = {
    val results = new Array[b](xs.length);
    replicate(0, xs.length) { i => results(i) = f(xs(i)) }
    results
  }
}

<commit_msg>- changed module into object<commit_after>package scala.concurrent;

object ops {

  def spawn(def p: Unit) = {
    val t = new Thread { override def run() = p; }
    t.run()
  }

  def future[a](def p: a): () => a = {
    val result = new SyncVar[a];
    spawn { result set p }
    () => result.get
  }

  def par[a, b](def xp: a, def yp: b): Pair[a, b] = {
    val y = new SyncVar[b];
    spawn { y set yp }
    Pair(xp, y.get)
  }

  def replicate(start: Int, end: Int)(def p: Int => Unit): Unit = {
    if (start == end) {
    } else if (start + 1 == end) {
      p(start)
    } else {
      val mid = (start + end) / 2;
      spawn { replicate(start, mid)(p) }
      replicate(mid, end)(p)
    }
  }

  def parMap[a,b](f: a => b, xs: Array[a]): Array[b] = {
    val results = new Array[b](xs.length);
    replicate(0, xs.length) { i => results(i) = f(xs(i)) }
    results
  }
}


{'fraction_non_alphanumeric': 0.1842555618938962, 'fraction_numerical': 0.0034227039361095267, 'mean_word_length': 2.248148148148148, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '5376522', 'n_tokens_mistral': 719, 'n_tokens_neox': 694, 'n_words': 198}