<commit_before>(function(global) {


    function jsonpost(url, payload, options) {
        var jsp = new Jsonpost(url, payload, options);
        jsp.execute();

    }

    function Jsonpost (url, payload, options) {
        this.url = url;
        this.payload = payload;
        this.options = options;
        this.options.uuid = uuid();
    }

    Jsonpost.prototype.execute = function() {
        // bind to message event 
        var binding = new EventListener(this.options, this.cleanup.bind(this));
        binding.addEvent();
        // create frame
        this.frame = new Frame(this.options).create().append();

        this.form = new Form(this.options).create(this.url).fill(this.payload).append().submit();
        console.log(this.frame, this.form);

    };

    Jsonpost.prototype.cleanup = function() {
        this.frame.remove();
        this.form.remove();
        delete this.frame;
        delete this.form;
    };

    /*
        ######################################
        # Frame<commit_msg>Adding return object with a cancel method<commit_after>(function(global) {


    function jsonpost(url, payload, options) {
        var jsp = new Jsonpost(url, payload, options);
        jsp.execute();

        return {
            cancel : jsp.cancel.bind(jsp)
        };

    }

    function Jsonpost (url, payload, options) {
        this.url = url;
        this.payload = payload;
        this.options = options;
        this.options.uuid = uuid();
    }

    Jsonpost.prototype.execute = function() {
        // bind to message event 
        this.binding = new EventListener(this.options, this.cleanup.bind(this));
        this.binding.addEvent();
        // create frame
        this.frame = new Frame(this.options).create().append();

        this.form = new Form(this.options).create(this.url).fill(this.payload).append().submit();
        console.log(this.frame, this.form);

    };

    Jsonpost.prototype.cancel = function() {
        this.binding && this.binding.removeEvent();
        this.cleanup();
    };

    Jsonpost.prototype.cleanup = function() {
        this.frame && this.frame.remove();
        this.form && this.form.remove();
        delete this.frame;
        delete this.form;
    };

    /*
        ######################################
        # Frame
{'fraction_non_alphanumeric': 0.1648590021691974, 'fraction_numerical': 0.0, 'mean_word_length': 2.1806896551724138, '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': '3890424', 'n_tokens_mistral': 645, 'n_tokens_neox': 617, 'n_words': 126}