<commit_before>
var getMatchingTypes= SpongeTools.getCachedData('getMatchingTypes');
var getMatchingObjects= SpongeTools.getCachedData('getMatchingObjects');
var getTags= SpongeTools.getCachedData('getTagsByTypeVersion');
var getMapnames= SpongeTools.getCachedData('getMapnamesByTypeVersion');

var _getObjectsByLocation= SpongeTools.getCachedData('getObjectsByLocation');
var getObjectsByLocation= function( type, versions, bounds ) {
    bounds= _.clone(bounds)
    bounds.east= Math.min(Math.floor(bounds.east + 1), 180);
    bounds.west= Math.floor(bounds.west);
    bounds.north= Math.min(Math.floor(bounds.north + 1), 90);
    bounds.south= Math.floor(bounds.south);
    return _getObjectsByLocation(type, versions, bounds);
};

var ObjectId= SpongeTools.ObjectId;

var ReactiveValue= SpongeTools.ReactiveValue;
var injectVar= SpongeTools.injectVar;
var injectGlobalVar= SpongeTools.injectGlobalVar;

var globalInvalidator= SpongeTools.getInvalidator('valueInput');

var currentValue;
var tempValue= {};

var arraylistInvalidator= SpongeTools.getInvalidator('arraylist');
var rangeviewInvalidator= SpongeTools.getObjectInvalidator('rangeview');

// maximum number of object's names to load
var limitDataObjs= 30;

var dateFormat= 'dd.mm.yyyy';

var T= SpongeTools.Template;

var selectFromMapInvalidator= SpongeTools.getInvalidator('select from map');

var Map= SpongeTools.Map;

/*
 * generic local temporary value
 */
var getTempValue= function( name, initValue ) {
    return injectVar(tempValue, name, initValue);
};


var inputType= function() {
    return getTempValue('inputType').apply(null, arguments);
};

/*
 * stores new values per type
 */
var newValue= function( _newValue ) {
    var type= inputType();
    if ( !type ) return;

    return getTempValue(type + '.value').apply(null, arguments);
};
var getNewValueInit= function( type, defaultValue ) {
    var value= getTempValue(type + '.value');
    var result= value();

    return result === undefined ? value(defaultValue) : result;
};

var singleValue= ReactiveValue({
    get: function() {},
    set: function() {},
    type: undefined,
    description: undefined,
    newValue: undefined,
});

/*
var singleValue= (function() {
    var invalidator= SpongeTools.getInvalidator('singlevalue');
    var value= {
        get: function() {},
        set: function() {},
        type: undefined,
        description: undefined,
        newValue: undefined,
    };
    return function( newValue ) {
        if ( !arguments.length ) {
            invalidator();
            return value;
        }
        invalidator(true);
        value= newValue;
    };
})();
*/

/*
 * gets the current value to edit
 * if value has changed, reset temporary values
 */
var getValue= function() {
    var value= injectGlobalVar('valueInput')();
    if ( value === currentValue ) return value;

    currentValue= value;

    // empty current values
    globalInvalidator(true);
    tempValue= {};

    return value;
};

var getType= function() {
    return (getValue() || {}).type;<commit_msg>removed unused code<commit_after>
var getMatchingTypes= SpongeTools.getCachedData('getMatchingTypes');
var getMatchingObjects= SpongeTools.getCachedData('getMatchingObjects');
var getTags= SpongeTools.getCachedData('getTagsByTypeVersion');
var getMapnames= SpongeTools.getCachedData('getMapnamesByTypeVersion');

var _getObjectsByLocation= SpongeTools.getCachedData('getObjectsByLocation');
var getObjectsByLocation= function( type, versions, bounds ) {
    bounds= _.clone(bounds)
    bounds.east= Math.min(Math.floor(bounds.east + 1), 180);
    bounds.west= Math.floor(bounds.west);
    bounds.north= Math.min(Math.floor(bounds.north + 1), 90);
    bounds.south= Math.floor(bounds.south);
    return _getObjectsByLocation(type, versions, bounds);
};

var ObjectId= SpongeTools.ObjectId;

var ReactiveValue= SpongeTools.ReactiveValue;
var injectVar= SpongeTools.injectVar;
var injectGlobalVar= SpongeTools.injectGlobalVar;

var globalInvalidator= SpongeTools.getInvalidator('valueInput');

var currentValue;
var tempValue= {};

var arraylistInvalidator= SpongeTools.getInvalidator('arraylist');
var rangeviewInvalidator= SpongeTools.getObjectInvalidator('rangeview');

// maximum number of object's names to load
var limitDataObjs= 30;

var dateFormat= 'dd.mm.yyyy';

var T= SpongeTools.Template;

var selectFromMapInvalidator= SpongeTools.getInvalidator('select from map');

var Map= SpongeTools.Map;

/*
 * generic local temporary value
 */
var getTempValue= function( name, initValue ) {
    return injectVar(tempValue, name, initValue);
};


var inputType= function() {
    return getTempValue('inputType').apply(null, arguments);
};

/*
 * stores new values per type
 */
var newValue= function( _newValue ) {
    var type= inputType();
    if ( !type ) return;

    return getTempValue(type + '.value').apply(null, arguments);
};
var getNewValueInit= function( type, defaultValue ) {
    var value= getTempValue(type + '.value');
    var result= value();

    return result === undefined ? value(defaultValue) : result;
};

var singleValue= ReactiveValue({
    get: function() {},
    set: function() {},
    type: undefined,
    description: undefined,
    newValue: undefined,
});

/*
 * gets the current value to edit
 * if value has changed, reset temporary values
 */
var getValue= function() {
    var value= injectGlobalVar('valueInput')();
    if ( value === currentValue ) return value;

    currentValue= value;

    // empty current values
    globalInvalidator(true);
    tempValue= {};

    return value;
};

var getType= function() {
    return (getValue() || {}).type;
{'fraction_non_alphanumeric': 0.12506652474720595, 'fraction_numerical': 0.0031931878658861094, 'mean_word_length': 4.516634050880627, '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': '6854721', 'n_tokens_mistral': 1719, 'n_tokens_neox': 1655, 'n_words': 422}