<commit_before>package pagerank

import (
  "testing"
  "math"
  "math/rand"
  "fmt"
)


func (f Float) round() Float {
  return Float(math.Floor(float64(f) * 10 + 0.5) / 10)
}

func (f Float) toPercentage() Float {
  tenPow3 := math.Pow(10, 3)
  return Float(100 * (float64(f) * tenPow3) / tenPow3).round()
}

func assertRank(t *testing.T, pageRank Interface, expected map[int]Float) {
  pageRank.Rank(0.85, 0.0001, func(label int, rank Float) {
    if Float(rank).toPercentage() != expected[label] {
      t.Error("Rank for", label, "should be", expected[label], "but was", Float(rank).toPercentage())
    }
  })
}

func assertEqual(t *testing.T, actual, expected interface{}) {
  if actual != expected {
    t.Error("Should be", expected, "but was", actual)
  }
}

func assert(t *testing.T, actual bool) {
  if !actual {
    t.Error("Should be true")
  }
}
<commit_msg>Use all CPUs<commit_after>package pagerank

import (
  "testing"
  "math"
  "math/rand"
  "fmt"
  "runtime"
)

func init(){
  runtime.GOMAXPROCS(runtime.NumCPU())
}

func (f Float) round() Float {
  return Float(math.Floor(float64(f) * 10 + 0.5) / 10)
}

func (f Float) toPercentage() Float {
  tenPow3 := math.Pow(10, 3)
  return Float(100 * (float64(f) * tenPow3) / tenPow3).round()
}

func assertRank(t *testing.T, pageRank Interface, expected map[int]Float) {
  pageRank.Rank(0.85, 0.0001, func(label int, rank Float) {
    if Float(rank).toPercentage() != expected[label] {
      t.Error("Rank for", label, "should be", expected[label], "but was", Float(rank).toPercentage())
    }
  })
}

func assertEqual(t *testing.T, actual, expected interface{}) {
  if actual != expected {
    t.Error("Should be", expected, "but was", actual)
  }
}

func assert(t *testing.T, actual bool) {
  if !actual {
    t.Error("Should be true")
  }
}

{'fraction_non_alphanumeric': 0.17025981205085683, 'fraction_numerical': 0.029850746268656716, 'mean_word_length': 3.7883597883597884, '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': '7439290', 'n_tokens_mistral': 713, 'n_tokens_neox': 670, 'n_words': 166}