<commit_before>package org.mapdb

import org.junit.Assert.*
import org.junit.Test
import java.io.*
import java.util.*
import java.util.concurrent.*
import java.util.concurrent.atomic.AtomicReference

/**
 * Unit tests utils
 */
object TT{

    val bools = booleanArrayOf(false,true)
    val boolsTrue = booleanArrayOf(true)
    val boolsFalse = booleanArrayOf(false)

    @JvmStatic fun randomByteArray(size: Int, seed: Int= Random().nextInt()): ByteArray {
        var randomSeed = seed
        val ret = ByteArray(size)
        for (i in ret.indices) {
            ret[i] = randomSeed.toByte()
            randomSeed = 269 * randomSeed + DataIO.intHash(randomSeed)
        }
        return ret
    }

    @JvmStatic fun randomFillStore(store:Store, size:Int=1000, seed:Long=Random().nextLong()){
        val random = Random(seed)
        for(i in 0..size){
            val bytes = randomByteArray(random.nextInt(100),seed=random.nextInt());
            store.put(
                    bytes,
                    Serializer.BYTE_ARRAY_NOSIZE);
        }
    }

    @JvmStatic fun randomString(size: Int, seed: Int=Random().nextInt()): String {
        val chars = "0123456789abcdefghijklmnopqrstuvwxyz !@#$%^&*()_+=-{}[]:\",./<>?|\\".toCharArray()
        var seed2 = seed
        val b = StringBuilder(size)
        for (i in 0..size - 1) {
            b.append(chars[Math.abs(seed2) % chars.size])
            seed2 = 31 * seed2 + DataIO.intHash(seed2)
        }
        return b.toString()
    }

    private val tempDir = System.getProperty("java.io.tmpdir");

    /*
     * Create temporary file in temp folder. All associated db files will be deleted on JVM exit.
     */
    @JvmStatic fun tempFile(): File {
        fun sanitize(name:String) = java.lang.String(name).replaceAll("[^a-zA-Z_\\.]+","")
<commit_msg>Fix <> in file name from constructor<commit_after>package org.mapdb

import org.junit.Assert.*
import org.junit.Test
import java.io.*
import java.util.*
import java.util.concurrent.*
import java.util.concurrent.atomic.AtomicReference

/**
 * Unit tests utils
 */
object TT{

    val bools = booleanArrayOf(false,true)
    val boolsTrue = booleanArrayOf(true)
    val boolsFalse = booleanArrayOf(false)

    @JvmStatic fun randomByteArray(size: Int, seed: Int= Random().nextInt()): ByteArray {
        var randomSeed = seed
        val ret = ByteArray(size)
        for (i in ret.indices) {
            ret[i] = randomSeed.toByte()
            randomSeed = 269 * randomSeed + DataIO.intHash(randomSeed)
        }
        return ret
    }

    @JvmStatic fun randomFillStore(store:Store, size:Int=1000, seed:Long=Random().nextLong()){
        val random = Random(seed)
        for(i in 0..size){
            val bytes = randomByteArray(random.nextInt(100),seed=random.nextInt());
            store.put(
                    bytes,
                    Serializer.BYTE_ARRAY_NOSIZE);
        }
    }

    @JvmStatic fun randomString(size: Int, seed: Int=Random().nextInt()): String {
        val chars = "0123456789abcdefghijklmnopqrstuvwxyz !@#$%^&*()_+=-{}[]:\",./<>?|\\".toCharArray()
        var seed2 = seed
        val b = StringBuilder(size)
        for (i in 0..size - 1) {
            b.append(chars[Math.abs(seed2) % chars.size])
            seed2 = 31 * seed2 + DataIO.intHash(seed2)
        }
        return b.toString()
    }

    private val tempDir = System.getProperty("java.io.tmpdir");

    /*
     * Create temporary file in temp folder. All associated db files will be deleted on JVM exit.
     */
    @JvmStatic fun tempFile(): File {
        fun sanitize(name:String) = java.lang.String(name).replaceAll("[^a-zA-Z0-9_\\.]+","")

{'fraction_non_alphanumeric': 0.13564410480349345, 'fraction_numerical': 0.016921397379912665, 'mean_word_length': 2.451035781544256, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '1183674', 'n_tokens_mistral': 1211, 'n_tokens_neox': 1143, 'n_words': 261}