<commit_before>var Transport = can.Control.extend({

  init: function(element, options) {
    this.status = options.status;
    element.html(can.view('views/transport.ejs'));
  },

  sendCommand: function(command) {
    var self = this;
    can.ajax({
      url: '/api/control/' + command,
      type: 'PUT',
      success: function(status) {
        self.status.attr(status);
      }
    });
  },

  'button click': function(element, event) {
    var command = $(element).data('command');
    this.sendCommand(command);
  }

});<commit_msg>Split out status update into its own function.<commit_after>var Transport = can.Control.extend({

  init: function(element, options) {
    this.status = options.status;
    element.html(can.view('views/transport.ejs'));
  },

  updateStatus: function(status) {
    this.status.attr(status);
  },

  sendCommand: function(command) {
    var self = this;
    can.ajax({
      url: '/api/control/' + command,
      type: 'PUT',
      success: function(status) {
        self.updateStatus(status);
      }
    });
  },

  'button click': function(element, event) {
    var command = $(element).data('command');
    this.sendCommand(command);
  }

});
{'fraction_non_alphanumeric': 0.16259477674810446, 'fraction_numerical': 0.0, 'mean_word_length': 2.9865771812080535, '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': '5807762', 'n_tokens_mistral': 373, 'n_tokens_neox': 365, 'n_words': 72}