<commit_before>'use strict';

//local imports
const utils = require('./utils');

class FormeBase {
    constructor(name) {
        this._name = name;
        this._label = this._name;
        this._context = {};
    }

    //private methods
    _clone(override) {
        //by ref
        return this;
    }

    //public methods
    name(name) {
        this._name = name;

        //chain
        return this;
    }

    label(label) {
        this._label = label;

        //chain
        return this;
    }

    context() {
        //get or set a context
        if (arguments.length == 1) {
            //get
            if (this._context[arguments[0]] !== undefined) {
                return this._context[arguments[0]];
            } else {
                return null;
            }
        } else if (arguments.length == 2) {
            //set
            if (arguments[1] === undefined) {
                delete this._context[arguments[0]];
            } else {
                this._context[arguments[0]] = arguments[1];
            }

            //chain
            return this;
        }
    }
}

module.exports = FormeBase;<commit_msg>fixed context return to undefined when none existant<commit_after>'use strict';

//local imports
const utils = require('./utils');

class FormeBase {
    constructor(name) {
        this._name = name;
        this._label = this._name;
        this._context = {};
    }

    //private methods
    _clone(override) {
        //by ref
        return this;
    }

    //public methods
    name(name) {
        this._name = name;

        //chain
        return this;
    }

    label(label) {
        this._label = label;

        //chain
        return this;
    }

    context() {
        //get or set a context
        if (arguments.length == 1) {
            //get
            if (this._context[arguments[0]] !== undefined) {
                return this._context[arguments[0]];
            } else {
                return undefined;
            }
        } else if (arguments.length == 2) {
            //set
            if (arguments[1] === undefined) {
                delete this._context[arguments[0]];
            } else {
                this._context[arguments[0]] = arguments[1];
            }

            //chain
            return this;
        }
    }
}

module.exports = FormeBase;
{'fraction_non_alphanumeric': 0.12116040955631399, 'fraction_numerical': 0.006825938566552901, 'mean_word_length': 1.3035363457760314, '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': '7074714', 'n_tokens_mistral': 657, 'n_tokens_neox': 627, 'n_words': 150}