<commit_before>(function(app, ko) {
  "use strict";

  var viewmodel_name = '<%= name.camelize %>',
      ViewmodelClass;

  ViewmodelClass = function <%= name.camelize %>() {
    kea.viewmodels.Parent.apply(this);
    kea.viewmodels.Child.apply(this);
    kea.viewmodels.Validatable.apply(this);

    var that = this;

    this._viewmodelName = function _viewmodelName() { return viewmodel_name; };

    this.exit       = ko.observable(false);
    this.shouldExit = function shouldExit() {
      var previous = that.exit();
      
      that.reset();
      that.exit(true);
      if (previous) { that.exit.valueHasMutated(); }
    };

    // this.context = ko.observable();
    // this.validatableName('context');

    this.submitInProgress = ko.observable(false);
    this.submitComplete   = ko.observable(false);
    
    // this.isSubmittable = ko.computed(function() {
    //   return !that.hasFieldsWithErrors() && !that.hasValidationsInProgress();
    // }, this, {deferEvaluation: true});
    
    this.ajaxInProgress   = ko.observable(false);
    this.ajaxDisabled     = ko.observable(false);
    this.submitComplete   = ko.observable(false);

    this.reset = function reset() {
      that.submitComplete(false);
      that.ajaxInProgress(false);
      that.ajaxDisabled(false);
    };

    this.setup = function setup(context) {
      this.reset();
      
      // context.makeValidatable();
      // that.context(context);
    };
    
    this.submit = function submit() {
      that.context().validate();

      // if (that.context().hasErrors() || that.submitInProgress() || !that.isSubmittable()) {
      //   return;
      // }
      
      that.submitInProgress(true);
      
      // return that.context().update()
      //   .done(function(asset) {
      //     that.submitComplete(true);
      //   })
      //   .always(function() {
      //     that.submitInProgress(false);
      //   });
    };
  };

  app.viewmodels[viewmodel_name] = ViewmodelClass;

})(window.app, ko);<commit_msg>Add missing namespace to generated viewmodels<commit_after>(function(app, kea, ko) {
  "use strict";

  var viewmodel_name = '<%= name.camelize %>',
      ViewmodelClass;

  ViewmodelClass = function <%= name.camelize %>() {
    kea.viewmodels.Parent.apply(this);
    kea.viewmodels.Child.apply(this);
    kea.viewmodels.Validatable.apply(this);

    var that = this;

    this._viewmodelName = function _viewmodelName() { return viewmodel_name; };

    this.exit       = ko.observable(false);
    this.shouldExit = function shouldExit() {
      var previous = that.exit();
      
      that.reset();
      that.exit(true);
      if (previous) { that.exit.valueHasMutated(); }
    };

    // this.context = ko.observable();
    // this.validatableName('context');

    this.submitInProgress = ko.observable(false);
    this.submitComplete   = ko.observable(false);
    
    // this.isSubmittable = ko.computed(function() {
    //   return !that.hasFieldsWithErrors() && !that.hasValidationsInProgress();
    // }, this, {deferEvaluation: true});
    
    this.ajaxInProgress   = ko.observable(false);
    this.ajaxDisabled     = ko.observable(false);
    this.submitComplete   = ko.observable(false);

    this.reset = function reset() {
      that.submitComplete(false);
      that.ajaxInProgress(false);
      that.ajaxDisabled(false);
    };

    this.setup = function setup(context) {
      this.reset();
      
      // context.makeValidatable();
      // that.context(context);
    };
    
    this.submit = function submit() {
      that.context().validate();

      // if (that.context().hasErrors() || that.submitInProgress() || !that.isSubmittable()) {
      //   return;
      // }
      
      that.submitInProgress(true);
      
      // return that.context().update()
      //   .done(function(asset) {
      //     that.submitComplete(true);
      //   })
      //   .always(function() {
      //     that.submitInProgress(false);
      //   });
    };
  };

  app.viewmodels[viewmodel_name] = ViewmodelClass;

})(window.app, window.kea, ko);
{'fraction_non_alphanumeric': 0.15719557195571957, 'fraction_numerical': 0.0, 'mean_word_length': 2.4663256606990624, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '6033373', 'n_tokens_mistral': 1269, 'n_tokens_neox': 1236, 'n_words': 182}