<commit_before>"use strict";

let check = require('check-types');
let chalk = require('chalk');

let versionManager = require('./versionManager.js');

let useCollection = function(collectionName){
    return (context) => {
        return new Promise((resolve, reject) => {
            Promise.resolve()
            .then(() => {
                check.assert.not.undefined(collectionName, "The collection name can not be undefined")
            })
            .then(() => {
                check.assert.nonEmptyString(collectionName, "The collection name must be provided")<commit_msg>Added undefined context prevention<commit_after>"use strict";

let check = require('check-types');
let chalk = require('chalk');

let versionManager = require('./versionManager.js');

let useCollection = function(collectionName){
    return (context) => {
        return new Promise((resolve, reject) => {
            Promise.resolve()
            .then(() => {
                check.assert.not.undefined(context, "The provided context can not be undefined")
            })
            .then(() => {
                check.assert.not.undefined(collectionName, "The collection name can not be undefined")
            })
            .then(() => {
                check.assert.nonEmptyString(collectionName, "The collection name must be provided")
{'fraction_non_alphanumeric': 0.1303692539562924, 'fraction_numerical': 0.0, 'mean_word_length': 2.550802139037433, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, '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': '2453207', 'n_tokens_mistral': 324, 'n_tokens_neox': 316, 'n_words': 87}