<commit_before>import Ember from 'ember';

const { isArray } = Ember;

var ABORT = 0;
var ROLLBACK = 1;
var BUBBLE = 2;

function addDirtyModel(dirtyModels, model) {
  if (isArray(model)) {
    model.filter(item => { return item.get('isDirty'); }).forEach(item => { dirtyModels.push(item); });
    return;
  }

  if (model.get('isDirty')) {
    dirtyModels.push(model);
  }
}

function getDirtyModels(model, dirtyRelationships) {<commit_msg>code consolidation<commit_after>import Ember from 'ember';

const { isArray } = Ember;

var ABORT = 0;
var ROLLBACK = 1;
var BUBBLE = 2;

function addDirtyModel(dirtyModels, model) {
  if (!isArray(model)) {
    model = [model];
  }

  model.forEach(m => {
    if (m.get('isDirty')) {
      dirtyModels.push(m);
    }
  });
}

function getDirtyModels(model, dirtyRelationships) {
{'fraction_non_alphanumeric': 0.1548780487804878, 'fraction_numerical': 0.007317073170731708, 'mean_word_length': 4.03680981595092, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '3813886', 'n_tokens_mistral': 308, 'n_tokens_neox': 294, 'n_words': 64}