<commit_before>
/**
 * menu bar sql module
 * this module is used to perform custom SQL queries on the table (and the map)
 */

cdb.admin.mod = cdb.admin.mod || {};

cdb.admin.mod.SQL = cdb.admin.Module.extend({

    _TEXTS: {
      tip: '<strong>Ctrl + SPACE</strong> to autocomplete. <strong><%= key %> + S</strong> to apply your query.'
    },

    _ACTION: {
      type: 'show',
      width: 600
    },

    buttonClass: 'sql_mod',
    type: 'tool',
    className: "sql_panel",
    
    events: {
      'click .actions a.clearview': '_clearView',
      'click .actions button':      'applyQuery',
      'click .actions a.next':      '_do',
      'click .actions a.back':      '_undo',
      'click .doc_info':            '_showDoc'
    },

    initialize: function() {
      _.bindAll(this, '_onKeyUpEditor');

      var self = this;
      this.user = this.options.user;
      this.template = this.getTemplate('table/menu_modules/views/sql');

      this.model.bind('change:table_name',      this._replaceSQL,       this); // Not for the moment
      this.model.bind('change:query',           this._updateSQL,        this);
      this.model.bind('change:query_generated', this._updateQueryInfo,  this);
      this.model.bind('errorSQLView',           this._onSQLError,       this);

      // Set query position from history array and last sql applied
      var history = this.model.get('query_history')
        , position = this.model.query_history_position
        , sql =  this.model.get('query') || this._defaultSQL();

      this.model.query_history_position = _.indexOf(history, sql) || 0;
      this.add_related_model(this.model);

      this._initBinds();

      // table list will be needed probably
      this.user.fetchTables();

      cdb.god.bind('end_show', this.activated, this)
      this.add_related_model(cdb.god);
    },

    render: function() {
      var self = this;
      this.clearSubViews();

      this.$el.append(this.template({}));

      this._initEditor();<commit_msg>Removed unnecessary comment<commit_after>
/**
 * menu bar sql module
 * this module is used to perform custom SQL queries on the table (and the map)
 */

cdb.admin.mod = cdb.admin.mod || {};

cdb.admin.mod.SQL = cdb.admin.Module.extend({

    _TEXTS: {
      tip: '<strong>Ctrl + SPACE</strong> to autocomplete. <strong><%= key %> + S</strong> to apply your query.'
    },

    _ACTION: {
      type: 'show',
      width: 600
    },

    buttonClass: 'sql_mod',
    type: 'tool',
    className: "sql_panel",
    
    events: {
      'click .actions a.clearview': '_clearView',
      'click .actions button':      'applyQuery',
      'click .actions a.next':      '_do',
      'click .actions a.back':      '_undo',
      'click .doc_info':            '_showDoc'
    },

    initialize: function() {
      _.bindAll(this, '_onKeyUpEditor');

      var self = this;
      this.user = this.options.user;
      this.template = this.getTemplate('table/menu_modules/views/sql');

      this.model.bind('change:table_name',      this._replaceSQL,       this);
      this.model.bind('change:query',           this._updateSQL,        this);
      this.model.bind('change:query_generated', this._updateQueryInfo,  this);
      this.model.bind('errorSQLView',           this._onSQLError,       this);

      // Set query position from history array and last sql applied
      var history = this.model.get('query_history')
        , position = this.model.query_history_position
        , sql =  this.model.get('query') || this._defaultSQL();

      this.model.query_history_position = _.indexOf(history, sql) || 0;
      this.add_related_model(this.model);

      this._initBinds();

      // table list will be needed probably
      this.user.fetchTables();

      cdb.god.bind('end_show', this.activated, this)
      this.add_related_model(cdb.god);
    },

    render: function() {
      var self = this;
      this.clearSubViews();

      this.$el.append(this.template({}));

      this._initEditor();
{'fraction_non_alphanumeric': 0.14321482223335003, 'fraction_numerical': 0.00200300450676014, 'mean_word_length': 2.4439655172413794, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '527939', 'n_tokens_mistral': 1257, 'n_tokens_neox': 1212, 'n_words': 273}