<commit_before>define([
  'jquery',
  'summernote/base/core/func',
  'summernote/base/core/list'
], function ($, func, list) {

  /**
   * @param {jQuery} $note
   * @param {Object} options
   * @return {Context}
   */
  var Context = function ($note, options) {
    var self = this;

    var ui = $.summernote.ui;
    this.modules = {};
    this.buttons = {};
    this.layoutInfo = {};
    this.options = options;

    this.initialize = function () {
      // create layout info
      this.layoutInfo = ui.createLayout($note, options);

      // add optional buttons
      var allButtons = $.extend({}, this.options.buttons, $.summernote.buttons || {});
      Object.keys(allButtons).forEach(function (key) {
        var button = allButtons[key];
        self.addButton(key, button);
      });

      // initialize module
      var allModules = $.extend({}, this.options.modules, $.summernote.modules || {});
      Object.keys(allModules).forEach(function (key) {
        self.addModule(key, allModules[key]);
      });

      Object.keys(this.modules).forEach(function (key) {
        if (self.modules[key].initialize) {
          self.modules[key].initialize();
        }
      });


      $note.hide();
      return this;
    };

    this.destroy = function () {
      Object.keys(this.modules).forEach(function (key) {
        self.removeModule(key);
      });

      $note.removeData('summernote');

      ui.removeLayout($note, this.layoutInfo);
    };

    this.code = function (html) {
      if (html === undefined) {
        var isActivated = this.invoke('codeview.isActivated');
        this.invoke('codeview.sync');
        return isActivated ? this.layoutInfo.codable.val() : this.layoutInfo.editable.html();
      }

      this.layoutInfo.editable.html(html);
    };
<commit_msg>Code cleaning for b908aab.<commit_after>define([
  'jquery',
  'summernote/base/core/func',
  'summernote/base/core/list'
], function ($, func, list) {

  /**
   * @param {jQuery} $note
   * @param {Object} options
   * @return {Context}
   */
  var Context = function ($note, options) {
    var self = this;

    var ui = $.summernote.ui;
    this.modules = {};
    this.buttons = {};
    this.layoutInfo = {};
    this.options = options;

    this.initialize = function () {
      // create layout info
      this.layoutInfo = ui.createLayout($note, options);

      // add optional buttons
      var buttons = $.extend({}, this.options.buttons, $.summernote.buttons || {});
      Object.keys(buttons).forEach(function (key) {
        self.addButton(key, buttons[key]);
      });

      // initialize module
      var modules = $.extend({}, this.options.modules, $.summernote.modules || {});
      Object.keys(modules).forEach(function (key) {
        self.addModule(key, modules[key]);
      });

      Object.keys(this.modules).forEach(function (key) {
        if (self.modules[key].initialize) {
          self.modules[key].initialize();
        }
      });

      $note.hide();
      return this;
    };

    this.destroy = function () {
      Object.keys(this.modules).forEach(function (key) {
        self.removeModule(key);
      });

      $note.removeData('summernote');

      ui.removeLayout($note, this.layoutInfo);
    };

    this.code = function (html) {
      if (html === undefined) {
        var isActivated = this.invoke('codeview.isActivated');
        this.invoke('codeview.sync');
        return isActivated ? this.layoutInfo.codable.val() : this.layoutInfo.editable.html();
      }

      this.layoutInfo.editable.html(html);
    };

{'fraction_non_alphanumeric': 0.16361588284990145, 'fraction_numerical': 0.0008448324415657561, 'mean_word_length': 2.4891944990176817, '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': '3908397', 'n_tokens_mistral': 1093, 'n_tokens_neox': 1063, 'n_words': 192}