<commit_before>MetaHub.import_all();
Bloom.import_all();
Vineyard.import_all();
var Edit_Arbor = Vineyard.Arbor.sub_class('Edit_Arbor', {
  block: 'edit-form',
  initialize: function(garden) {
    this.garden = garden;
    var self = this;
    this.element.find('input[type=submit], button[type=submit], #submit').click(function(e) {
      e.preventDefault();
      self.seed.plant();
    });
    this.element.find('#cancel, .cancel').click(function(e) {
      self.garden.vineyard.trellises.todo.disconnect_all('seed');
      e.preventDefault();
      history.back();
    });
    this.element.find('#delete, .delete').click(function(e) {
      e.preventDefault();
      if (window.Confirmation_Dialog) {
        var dialog = Confirmation_Dialog.create({
          question: 'Are you sure you want to delete ' + self.seed.name + '?'
        });
        dialog.options.title = 'Delete ' + Vine.pretty_name(self.seed.trellis.name);
        self.listen(dialog, 'yes', function() {
          self.seed._delete();
        });
        dialog.show();
      }
      else {
        self.seed._delete();
      }
    });
  }
});
var Content_Panel = Plot = Flower.sub_class('Content_Panel', {
  arbors: {},
  default_arbor: Edit_Arbor,
  initialize: function() {
    this.content = this.element;
  },
  get_arbor: function(trellis, action) {
    var name;
    if (action) {
      name = action + '.' + trellis.name;
      if (this.arbors[name])
        return this.arbors[name];
      name = '*.' + trellis.name
      if (this.arbors[name])
        return this.arbors[name];
      // 'create' defaults to 'edit'.
      if (action == 'create') {
        return this.get_arbor(trellis, 'edit');
      }
    }
    else if (this.arbors[trellis.name])
      return this.arbors[trellis.name];
    return this.default_arbor;
  },
  index: function(request) {
    var name = request.trellis;
    var self = this;
    this.content.empty();
    var seed = Seed_List.create(self.garden.vineyard.trellises[name]);
    seed.query = function() {
      return Bloom.join(self.garden.app_path, 'vineyard', name);
    };<commit_msg>Fixed a bug where Plot.get_arbor() was a little too eager to rely on the default arbor.<commit_after>MetaHub.import_all();
Bloom.import_all();
Vineyard.import_all();
var Edit_Arbor = Vineyard.Arbor.sub_class('Edit_Arbor', {
  block: 'edit-form',
  initialize: function(garden) {
    this.garden = garden;
    var self = this;
    this.element.find('input[type=submit], button[type=submit], #submit').click(function(e) {
      e.preventDefault();
      self.seed.plant();
    });
    this.element.find('#cancel, .cancel').click(function(e) {
      self.garden.vineyard.trellises.todo.disconnect_all('seed');
      e.preventDefault();
      history.back();
    });
    this.element.find('#delete, .delete').click(function(e) {
      e.preventDefault();
      if (window.Confirmation_Dialog) {
        var dialog = Confirmation_Dialog.create({
          question: 'Are you sure you want to delete ' + self.seed.name + '?'
        });
        dialog.options.title = 'Delete ' + Vine.pretty_name(self.seed.trellis.name);
        self.listen(dialog, 'yes', function() {
          self.seed._delete();
        });
        dialog.show();
      }
      else {
        self.seed._delete();
      }
    });
  }
});
var Content_Panel = Plot = Flower.sub_class('Content_Panel', {
  arbors: {},
  default_arbor: Edit_Arbor,
  initialize: function() {
    this.content = this.element;
  },
  get_arbor: function(trellis, action) {
    var name;
    if (action) {
      name = action + '.' + trellis.name;
      if (this.arbors[name])
        return this.arbors[name];
      name = '*.' + trellis.name
      if (this.arbors[name])
        return this.arbors[name];
      // 'create' defaults to 'edit'.
      if (action == 'create') {
        return this.get_arbor(trellis, 'edit');
      }
    }
    
    if (this.arbors[trellis.name])
      return this.arbors[trellis.name];
    return this.default_arbor;
  },
  index: function(request) {
    var name = request.trellis;
    var self = this;
    this.content.empty();
    var seed = Seed_List.create(self.garden.vineyard.trellises[name]);
    seed.query = function() {
      return Bloom.join(self.garden.app_path, 'vineyard', name);
    };
{'fraction_non_alphanumeric': 0.15841121495327104, 'fraction_numerical': 0.0, 'mean_word_length': 2.722608695652174, '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': '7076086', 'n_tokens_mistral': 1428, 'n_tokens_neox': 1415, 'n_words': 250}