<commit_before>import {
    default as clone
} from 'clone';
import {
    default as memdown
} from 'memdown';

import * as schemas from './schemas';
import * as schemaObjects from './schema-objects';

import * as util from '../../dist/lib/util';
import * as testUtil from './test-util';
import * as RxDatabase from '../../dist/lib/RxDatabase';
import * as RxSchema from '../../dist/lib/RxSchema';

import * as RxDB from '../../dist/lib/index';

const dbLifetime = 1000 * 2; // db.destroy() will be called after this time

export async function create(size = 20, name = 'human', multiInstance = true) {
    if (!name) name = 'human';
    RxDB.PouchDB.plugin(require('pouchdb-adapter-memory'));
    const db = await RxDatabase.create({
        name: util.randomCouchString(10),
        adapter: 'memory',
        multiInstance
    });

    const collection = await db.collection({
        name,
        schema: schemas.human
    });

    // insert data
    const fns = [];
    for (let i = 0; i < size; i++)
        fns.push(collection.insert(schemaObjects.human()));
    await Promise.all(fns);

    return collection;
}
<commit_msg>REMOVE unused testUtil<commit_after>import {
    default as clone
} from 'clone';
import {
    default as memdown
} from 'memdown';

import * as schemas from './schemas';
import * as schemaObjects from './schema-objects';

import * as util from '../../dist/lib/util';
import * as RxDatabase from '../../dist/lib/RxDatabase';
import * as RxSchema from '../../dist/lib/RxSchema';

import * as RxDB from '../../dist/lib/index';

const dbLifetime = 1000 * 2; // db.destroy() will be called after this time

export async function create(size = 20, name = 'human', multiInstance = true) {
    if (!name) name = 'human';
    RxDB.PouchDB.plugin(require('pouchdb-adapter-memory'));
    const db = await RxDatabase.create({
        name: util.randomCouchString(10),
        adapter: 'memory',
        multiInstance
    });

    const collection = await db.collection({
        name,
        schema: schemas.human
    });

    // insert data
    const fns = [];
    for (let i = 0; i < size; i++)
        fns.push(collection.insert(schemaObjects.human()));
    await Promise.all(fns);

    return collection;
}

{'fraction_non_alphanumeric': 0.15174574753804834, 'fraction_numerical': 0.008952551477170993, 'mean_word_length': 2.788135593220339, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6591583', 'n_tokens_mistral': 691, 'n_tokens_neox': 664, 'n_words': 205}