<commit_before>var QueryScenario = Backbone.Model.extend({
    initialize: function(args, options) {
        // Maintain `this`
        _.bindAll(this, "attach_listeners", "clicked_cell", "save_writeback", 
            "cancel_writeback", "check_input");
        
        this.query = options.query;
        this.query.workspace.bind('table:render', this.attach_listeners);
    },
    
    attach_listeners: function(args) {
        $(args.workspace.el).find("td.data").click(this.clicked_cell);
    },
    
    clicked_cell: function(event) {
        $target = $(event.target).hasClass('data') ?
            $(event.target).find('div') : $(event.target);
        var value = $target.attr('alt');
                    var pos = $target.attr('rel');
        
        var $input = $("<input type='text' value='" + value + "' />")
            .keyup(this.check_input)
            .blur(this.cancel_writeback);
        $target.html('').append($input);
        $input.focus();
    },
    
    check_input: function(event) {
        if (event.which == 13) {
            this.save_writeback(event);
        } else if (event.which == 27 || event.which == 9) {
            this.cancel_writeback(event);
        }
         
        return false;
    },<commit_msg>Do check for scenario property<commit_after>var QueryScenario = Backbone.Model.extend({
    initialize: function(args, options) {
        // Maintain `this`
        _.bindAll(this, "attach_listeners", "clicked_cell", "save_writeback", 
            "cancel_writeback", "check_input");
        
        this.query = options.query;
        this.query.workspace.bind('table:render', this.attach_listeners);
    },
    
    attach_listeners: function(args) {
        if (args.workspace.query && args.workspace.query.properties &&
            args.workspace.query.properties.properties['org.saiku.connection.scenario'] === "true")
        $(args.workspace.el).find("td.data").click(this.clicked_cell);
    },
    
    clicked_cell: function(event) {
        $target = $(event.target).hasClass('data') ?
            $(event.target).find('div') : $(event.target);
        var value = $target.attr('alt');
                    var pos = $target.attr('rel');
        
        var $input = $("<input type='text' value='" + value + "' />")
            .keyup(this.check_input)
            .blur(this.cancel_writeback);
        $target.html('').append($input);
        $input.focus();
    },
    
    check_input: function(event) {
        if (event.which == 13) {
            this.save_writeback(event);
        } else if (event.which == 27 || event.which == 9) {
            this.cancel_writeback(event);
        }
         
        return false;
    },
{'fraction_non_alphanumeric': 0.1607275426874536, 'fraction_numerical': 0.003711952487008166, 'mean_word_length': 2.1668625146886016, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1188595', 'n_tokens_mistral': 820, 'n_tokens_neox': 805, 'n_words': 125}