<commit_before>$values: ();

foo {
    $num: random();
    $is-number: type-of($num) == number;
    $is-within-range: $num >= 0 and $num < 1;
    $is-random: index($values, $num) == null;
    $values: append($values, $num);

    @for $i from 1 through 1000 {
      $num: random();
      $is-number: $is-number and type-of($num) == number;
      $is-within-range: $is-within-range and $num >= 0 and $num < 1;
      $is-random: $is-random and index($values, $num) == null;
      $values: append($values, $num);
    }

    is-defined: $num != "random()";
    is-number: $is-number;
    is-within-range: $is-within-range;
    is-random: $is-random;
}
<commit_msg>Make random test more fault tolerant<commit_after>$values: ();

foo {
    $duplicates: 0;
    $num: random();
    $is-number: type-of($num) == number;
    $is-within-range: $num >= 0 and $num < 1;
    $values: append($values, $num);

    @for $i from 1 through 1000 {
      $num: random();
      $is-number: $is-number and type-of($num) == number;
      $is-within-range: $is-within-range and $num >= 0 and $num < 1;
      @if (index($values, $num) != null) { $duplicates: $duplicates + 1; }
      $values: append($values, $num);
    }

    is-defined: $num != "random()";
    is-number: $is-number;
    is-within-range: $is-within-range;
    is-random: $duplicates < 25;
}

{'fraction_non_alphanumeric': 0.2010502625656414, 'fraction_numerical': 0.016504126031507877, 'mean_word_length': 2.8005698005698005, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 7, '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': '6716636', 'n_tokens_mistral': 528, 'n_tokens_neox': 488, 'n_words': 123}