<commit_before>var PATH = require('./path'),
    INHERIT = require('inherit'),
    createTech = require('./tech').createTech,
    bemUtil = require('./util'),
    isRequireable = bemUtil.isRequireable,
    isRequireError = bemUtil.isRequireError,

    getLevelClass = function(path) {
        var level = requireLevel(path);
        if(level.Level) return level.Level;
        return INHERIT(level.baseLevelPath? getLevelClass(level.baseLevelPath) : Level, level);
    },

    requireLevel = function(path) {
        try {
            var level = bemUtil.requireWrapper(require)(PATH.resolve(path), true);
        } catch (e) {
            if(!isRequireError(e)) throw e;
        }
        return level || {};
    };

/**
 * Create level object from path on filesystem.
 *
 * @param {String} path  Path to level directory.
 * @return {Level}  Level object.
 */
exports.createLevel = function(path) {
    // NOTE: в директории .bem внутри уровня переопределения
    // лежит модуль-конфиг для уровня переопределения
    return new (getLevelClass(PATH.join(PATH.absolute(path), '.bem', 'level.js')))(path);
};

var Level = exports.Level = INHERIT(/** @lends Level.prototype */{

    /**
     * Create an instance of Level.
     *
     * @class Level
     * @constructs
     */
    __constructor: function(path) {
        this.dir = PATH.absolute(path);
        // NOTE: keep this.path for backwards compatability
        this.path = this.bemDir = PATH.join(this.dir, '.bem');

        // NOTE: tech modules cache
        this._techsCache = {};
    },

    /**
     * Place to store uncommon level configurations
     *
     * @return {Object}
     */
    getConfig: function() {
        return {};
    },

    /**<commit_msg>Update jsdoc for Level class constructor<commit_after>var PATH = require('./path'),
    INHERIT = require('inherit'),
    createTech = require('./tech').createTech,
    bemUtil = require('./util'),
    isRequireable = bemUtil.isRequireable,
    isRequireError = bemUtil.isRequireError,

    getLevelClass = function(path) {
        var level = requireLevel(path);
        if(level.Level) return level.Level;
        return INHERIT(level.baseLevelPath? getLevelClass(level.baseLevelPath) : Level, level);
    },

    requireLevel = function(path) {
        try {
            var level = bemUtil.requireWrapper(require)(PATH.resolve(path), true);
        } catch (e) {
            if(!isRequireError(e)) throw e;
        }
        return level || {};
    };

/**
 * Create level object from path on filesystem.
 *
 * @param {String} path  Path to level directory.
 * @return {Level}  Level object.
 */
exports.createLevel = function(path) {
    // NOTE: в директории .bem внутри уровня переопределения
    // лежит модуль-конфиг для уровня переопределения
    return new (getLevelClass(PATH.join(PATH.absolute(path), '.bem', 'level.js')))(path);
};

var Level = exports.Level = INHERIT(/** @lends Level.prototype */{

    /**
     * Construct an instance of Level.
     *
     * @class Level base class.
     * @constructs
     * @param {String} path  Level directory path.
     */
    __constructor: function(path) {
        this.dir = PATH.absolute(path);
        // NOTE: keep this.path for backwards compatability
        this.path = this.bemDir = PATH.join(this.dir, '.bem');

        // NOTE: tech modules cache
        this._techsCache = {};
    },

    /**
     * Place to store uncommon level configurations
     *
     * @return {Object}
     */
    getConfig: function() {
        return {};
    },

    /**
{'fraction_non_alphanumeric': 0.13506640293868324, 'fraction_numerical': 0.0, 'mean_word_length': 2.4808259587020647, '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': '1397835', 'n_tokens_mistral': 1070, 'n_tokens_neox': 1065, 'n_words': 255}