<commit_before>//############################################################################
// Lists
//############################################################################
// $Id$

//############################################################################

import java.lang.System; // to avoid name clash with .NET's library

object Test {

  val xs1 = List(1, 2, 3);
  val xs2 = List('a', 'b');
  val xs3 = List(List(1, 2), List(4, 5));
  val xs4 = List(2, 4, 6, 8);
  val xs5 = List(List(3, 4), List(3), List(4, 5));

  def check_count: int = {
    val n1 = xs1 count { e => e % 2 != 0 };
    val n2 = xs4 count { e => e < 5 };
    n1 + n2
  }

  def check_diff: int = {
    val ys1 = xs1 diff xs4;
    val ys2 = xs3 diff xs5;
    ys1.length + ys2.length
  }

  def check_exists: boolean = {
    val b1 = xs1 exists { e => e % 2 == 0 };
    val b2 = xs4 exists { e => e == 5 };
    b1 & b2
  }

  def check_filter: int = {
    val ys1 = xs1 filter { e => e % 2 == 0 };
    val ys2 = xs4 filter { e => e < 5 };
    ys1.length + ys2.length
  }

  def check_foldLeft: int = {
    val n1 = xs1.foldLeft(0)((e1, e2) => e1 + e2);
    val ys1 = xs4.foldLeft(List[Int]())((e1, e2) => e2 :: e1);
    n1 + ys1.length
  }

  def check_forall: boolean = {
    val b1 = xs1 forall { e => e < 10};
    val b2 = xs4 forall { e => e % 2 == 0 };
    b1 & b2
  }

  def check_intersect: int = {
    val ys1 = xs1 intersect xs4;
    val ys2 = xs3 intersect xs5;
    ys1.length + ys2.length
  }

  def check_remove: int = {
    val ys1 = xs1 remove { e => e % 2 != 0 };
    val ys2 = xs4 remove { e => e < 5 };
    ys1.length + ys2.length
  }

  def check_union: int = {
    val ys1 = xs1 union xs4;
    val ys2 = xs3 union xs5;
    ys1.length + ys2.length
  }

  def check_zip: int = {
    val ys1 = xs1 zip xs2;
    val ys2 = xs1 zip xs3;
    ys1.length + ys2.length
  }

  def check_zipAll: int = {
    val ys1 = xs1.zipAll(xs2, 0, '_');
    val ys2 = xs1.zipAll(xs3, 0, List(-1));
    ys1.length + ys2.length
  }

  def check_success[A](name: String, def closure: A, expected: A): Unit = {
    System.out.print("test " + name);
    try {
      val actual: A = closure;
      if (actual == expected)
        System.out.print(" was successful");
      else
        System.out.print(" failed: expected "+ expected +", found "+ actual);<commit_msg>- updated code for deprecated def-parameters.<commit_after>//############################################################################
// Lists
//############################################################################
// $Id$

//############################################################################

import java.lang.System; // to avoid name clash with .NET's library

object Test {

  val xs1 = List(1, 2, 3);
  val xs2 = List('a', 'b');
  val xs3 = List(List(1, 2), List(4, 5));
  val xs4 = List(2, 4, 6, 8);
  val xs5 = List(List(3, 4), List(3), List(4, 5));

  def check_count: int = {
    val n1 = xs1 count { e => e % 2 != 0 };
    val n2 = xs4 count { e => e < 5 };
    n1 + n2
  }

  def check_diff: int = {
    val ys1 = xs1 diff xs4;
    val ys2 = xs3 diff xs5;
    ys1.length + ys2.length
  }

  def check_exists: boolean = {
    val b1 = xs1 exists { e => e % 2 == 0 };
    val b2 = xs4 exists { e => e == 5 };
    b1 & b2
  }

  def check_filter: int = {
    val ys1 = xs1 filter { e => e % 2 == 0 };
    val ys2 = xs4 filter { e => e < 5 };
    ys1.length + ys2.length
  }

  def check_foldLeft: int = {
    val n1 = xs1.foldLeft(0)((e1, e2) => e1 + e2);
    val ys1 = xs4.foldLeft(List[Int]())((e1, e2) => e2 :: e1);
    n1 + ys1.length
  }

  def check_forall: boolean = {
    val b1 = xs1 forall { e => e < 10};
    val b2 = xs4 forall { e => e % 2 == 0 };
    b1 & b2
  }

  def check_intersect: int = {
    val ys1 = xs1 intersect xs4;
    val ys2 = xs3 intersect xs5;
    ys1.length + ys2.length
  }

  def check_remove: int = {
    val ys1 = xs1 remove { e => e % 2 != 0 };
    val ys2 = xs4 remove { e => e < 5 };
    ys1.length + ys2.length
  }

  def check_union: int = {
    val ys1 = xs1 union xs4;
    val ys2 = xs3 union xs5;
    ys1.length + ys2.length
  }

  def check_zip: int = {
    val ys1 = xs1 zip xs2;
    val ys2 = xs1 zip xs3;
    ys1.length + ys2.length
  }

  def check_zipAll: int = {
    val ys1 = xs1.zipAll(xs2, 0, '_');
    val ys2 = xs1.zipAll(xs3, 0, List(-1));
    ys1.length + ys2.length
  }

  def check_success[A](name: String, closure: => A, expected: A): Unit = {
    System.out.print("test " + name);
    try {
      val actual: A = closure;
      if (actual == expected)
        System.out.print(" was successful");
      else
        System.out.print(" failed: expected "+ expected +", found "+ actual);
{'fraction_non_alphanumeric': 0.2400932400932401, 'fraction_numerical': 0.052977325704598434, 'mean_word_length': 2.427741466957153, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 28, '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': '6582701', 'n_tokens_mistral': 1953, 'n_tokens_neox': 1768, 'n_words': 527}