<commit_before>@function enum($n) {
  $h: abs($n) % 100; $t: $h % 10;
  @if $h > 3 and $h < 21 { @return #{$n}th; }
  @return #{$n}#{if($h == 1, 'st', if($t == 2, 'nd', if($t == 3, 'rd', 'th')))};
}<commit_msg>add testing functions to beta<commit_after>//  _          _
// | |        | |
// | |__   ___| |_ __ _
// | '_ \ / _ \ __/ _` |
// | |_) |  __/ || (_| |
// |_.__/ \___|\__\__,_|

@function enum($n) {
  $h: abs($n) % 100; $t: $h % 10;
  @if $h > 3 and $h < 21 { @return #{$n}th; }
  @return #{$n}#{if($h == 1, 'st', if($t == 2, 'nd', if($t == 3, 'rd', 'th')))};
}

@function contains-duplicates($list) {
  $holding: ();
  @each $item in $list {
    @if index($holding, $item) { @return true; }
    $holding: append($holding, $item);
  }
  @return false;
}

/// An equivalent of `zip` function but for maps.
/// Takes two lists, the first for keys, second for values.
/// @param {List} $keys - Keys for map
/// @param {List} $values - Values for map
/// @return {Map} Freshly created map
/// @see http://sass-lang.com/documentation/Sass/Script/Functions.html#zip-instance_method
@function map-zip($keys, $values) {
  $l-keys: length($keys);
  $l-values: length($values);
  $min: min($l-keys, $l-values);
  $map: ();

  @if $l-keys != $l-values {
    @warn "There are #{$l-keys} key(s) for #{$l-values} value(s) in the map for `map-zip`. "
        + "Resulting map will only have #{$min} pairs.";
  }

  @if $min == 0 {
    @return $map;
  }

  @for $i from 1 through $min {
    $map: map-merge($map, (nth($keys, $i): nth($values, $i)));
  }

  @return $map;
}

/// Change key case of all keys in map
/// @param {Map} $map
/// @param {String} $case ("lower-case") - Either `lower-case` or `upper-case`
/// @return {Map}
@function map-change-key-case($map, $case: "lower-case") {
  $values: "lower-case", "upper-case";

  @if index($values, $case) == null {
    // Changing `@error` to `@warn` because GitHub syntax highlighter is a mess...
    @warn "Argument `$case` for `map-change-key-case` must be one of: #{$values}.";
  }

  @each $key, $value in $map {
    $new-key: call("to-" + $case, $key);

    @if $key != $new-key {
      $map: map-merge(map-remove($map, $key), (
        $new-key: $value
      ));
    }
  }

  @return $map;
}
/// Compute the maximum depth of a map
/// @param {Map} $map
/// @return {Number} max depth of `$map`
@function map-depth($map) {
  $level: 1;

  @each $key, $value in $map {
    @if type-of($value) == "map" {
      $level: max(map-depth($value) + 1, $level);
    }
  }

  @return $level;
}

/// Prints a map as a CSS rule
/// @access private
/// @param {Map} $map
@mixin debug-map($map) {
  @at-root {
    @debug-map {
      __toString__: inspect($map);
      __length__: length($map);
      __depth__: if(function-exists("map-depth"), map-depth($map), null);
      __keys__: map-keys($map);
      __properties__ {
        @each $key, $value in $map {
          #{'(' + type-of($value) + ') ' + $key}: inspect($value);
        }
      }
    }
  }
}
{'fraction_non_alphanumeric': 0.23230974632843793, 'fraction_numerical': 0.008678237650200267, 'mean_word_length': 2.6239419588875452, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3563123', 'n_tokens_mistral': 1206, 'n_tokens_neox': 1160, 'n_words': 307}