<commit_before>define(function (require, exports, module) {
    var $ = require('jquery');
    var _ = require('underscore');
    var rich = require('rich');
    var utils = require('rich/utils');

    function Setup(el, done){

        if(_.isFunction(el)){
            done = el;
            el = null;
        }

        this._done = done;

        this.root = this.initializeRoot(el);
        this.region = this.initializeRegion(this.root);
        this.context = this.root.context;
        this.$el = $(this.context.container);

        this.root.constraints = [
            {
                item: this.region,
                attribute: 'width',
                relatedBy: '==',
                toItem: this.root,
                toAttribute: 'width'
            },

            {
                item: this.region,
                attribute: 'height',
                relatedBy: '==',
                toItem: this.root,
                toAttribute: 'height'
            }
        ];
    }

    Setup.prototype.initializeRoot = function(el){
        el || (el = '#famous-context');

        var root = utils.initializeRichContext({
            el: el
        });

        return root;
    };

    Setup.prototype.initializeRegion = function(root){
        var region = new rich.Region();
        root.addSubview(region);
        return region;
    };

    Setup.prototype.done = function(){
        this.cleanup();

        if(this._done)
            this._done();
    };

    Setup.prototype.cleanup = function(){
        utils.disposeRichContext(this.root);

        var resize = this.root.context._eventOutput.listeners['resize'][0];

        _.each(this.root.context._eventOutput.listeners['resize'], function(handler){
            this.root.context._eventOutput.removeListener('resize', handler);
        }, this);

        this.root.destroy();
        this.region.destroy();

        this.root = null;
        this.region = null;
    };

    exports.Setup = Setup;<commit_msg>adds a name to the setup created region<commit_after>define(function (require, exports, module) {
    var $ = require('jquery');
    var _ = require('underscore');
    var rich = require('rich');
    var utils = require('rich/utils');

    function Setup(el, done){

        if(_.isFunction(el)){
            done = el;
            el = null;
        }

        this._done = done;

        this.root = this.initializeRoot(el);
        this.region = this.initializeRegion(this.root);
        this.context = this.root.context;
        this.$el = $(this.context.container);

        this.root.constraints = [
            {
                item: this.region,
                attribute: 'width',
                relatedBy: '==',
                toItem: this.root,
                toAttribute: 'width'
            },

            {
                item: this.region,
                attribute: 'height',
                relatedBy: '==',
                toItem: this.root,
                toAttribute: 'height'
            }
        ];
    }

    Setup.prototype.initializeRoot = function(el){
        el || (el = '#famous-context');

        var root = utils.initializeRichContext({
            el: el
        });

        return root;
    };

    Setup.prototype.initializeRegion = function(root){
        var region = new rich.Region();
        region.name = 'setup.region';
        root.addSubview(region);
        return region;
    };

    Setup.prototype.done = function(){
        this.cleanup();

        if(this._done)
            this._done();
    };

    Setup.prototype.cleanup = function(){
        utils.disposeRichContext(this.root);

        var resize = this.root.context._eventOutput.listeners['resize'][0];

        _.each(this.root.context._eventOutput.listeners['resize'], function(handler){
            this.root.context._eventOutput.removeListener('resize', handler);
        }, this);

        this.root.destroy();
        this.region.destroy();

        this.root = null;
        this.region = null;
    };

    exports.Setup = Setup;
{'fraction_non_alphanumeric': 0.13310242454230578, 'fraction_numerical': 0.0004948045522018803, 'mean_word_length': 1.661619486504279, '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': '3266425', 'n_tokens_mistral': 1122, 'n_tokens_neox': 1066, 'n_words': 200}