<commit_before>// Add numeric matrices
// --------------------------------------------------------------------------------
// @require `rows`
// @require `columns`
// @require `get-entry`
// @require `set-entry`
// --------------------------------------------------------------------------------
// @param $matrix1: first matrix
// @param $matrix2: second matrix
// --------------------------------------------------------------------------------
// @return matrix

@function add-matrices($matrix1, $matrix2) {
  @if rows($matrix1) != rows($matrix2)
  or columns($matrix1) != columns($matrix2) {
    @return false;
  }

  @for $i from 1 through rows($matrix1) {
    @for $j from 1 through rows($matrix2) {
      $value: get-entry($matrix1, ($i $j)) + get-entry($matrix2, ($i $j));
      $matrix1: set-entry($matrix1, ($i $j), $value);
    }
  }
  @return $matrix1;
}<commit_msg>Fixing an issue with add-matrices<commit_after>// Add `$matrices`
// --------------------------------------------------------------------------------
// @require `rows`
// @require `columns`
// @require `get-entry`
// @require `set-entry`
// --------------------------------------------------------------------------------
// @param $matrices: matrices
// --------------------------------------------------------------------------------
// @return matrix

@function add-matrices($matrices...) {
  $matrix: nth($matrices, 1);
  @each $m in $matrices {
    @if columns($matrix) != columns($m)
    or rows($matrix) != rows($m) {
      @warn "All matrices do not have same dimensions.";
      @return false;
    }
  }

  @for $i from 1 through rows($matrix) {
    @for $j from 1 through columns($matrix) {
      $value: null;
      @each $m in $matrices {
        $entry: get-entry($m, ($i $j));
        $value: if($value == null, $entry, $value + $entry);
      }
      $matrix: set-entry($matrix, ($i $j), $value);
    }
  }
  @return $matrix;
}
{'fraction_non_alphanumeric': 0.3992712129099427, 'fraction_numerical': 0.010411244143675169, 'mean_word_length': 1.255868544600939, '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': '1861509', 'n_tokens_mistral': 525, 'n_tokens_neox': 515, 'n_words': 139}