<commit_before>import DataAdapter from '@ember/debug/data-adapter';
import { inject as service } from '@ember/service';
import { get } from '@ember/object';
import Model from './document/model';
import Models from './document/models';

// https://github.com/emberjs/data/blob/master/addon/-private/system/debug/debug-adapter.js

export default DataAdapter.extend({

  stores: service(),

  detect(typeClass) {
    if(typeClass === Model) {
      return;
    }
    if(typeClass === Models) {
      return;
    }
    if(Model.detect(typeClass)) {
      return true;
    }
    if(Models.detect(typeClass)) {
      return true;
    }
  },

  columnsForType(typeClass) {
    let debug = get(typeClass, '_debug');
    let columns = debug && debug.columns || [];
    return columns;
  },

  getRecords(modelClass) {
    return this.get('stores.modelsIdentity').modelsByClass(modelClass);
  },

  getRecordColumnValues(model) {
    let columns = this.columnsForType(model.constructor);
    let values = {};
    columns.forEach(col => {
      values[col.name] = model.get(col.name);
    });
    return values;<commit_msg>don't include models with `-` prefix<commit_after>import DataAdapter from '@ember/debug/data-adapter';
import { inject as service } from '@ember/service';
import { get, set } from '@ember/object';
import { typeOf } from '@ember/utils';
import Model from './document/model';
import Models from './document/models';

// https://github.com/emberjs/data/blob/master/addon/-private/system/debug/debug-adapter.js

const __documents_data_adapter_name = '__documents_data_adapter_name';

export default DataAdapter.extend({

  stores: service(),

  _nameToClass(name) {
    let result = this._super(...arguments);
    if(typeOf(result) === 'class') {
      set(result, __documents_data_adapter_name, name);
    }
    return result;
  },

  detect(typeClass) {
    if(typeClass === Model) {
      return;
    }
    if(typeClass === Models) {
      return;
    }
    if(!Model.detect(typeClass) && !Models.detect(typeClass)) {
      return;
    }
    let name = get(typeClass, __documents_data_adapter_name);
    if(name) {
      let components = name.split('/');
      if(components[components.length - 1].indexOf('-') === 0) {
        return;
      }
    }
    return true;
  },

  columnsForType(typeClass) {
    let debug = get(typeClass, '_debug');
    let columns = debug && debug.columns || [];
    return columns;
  },

  getRecords(modelClass) {
    return this.get('stores.modelsIdentity').modelsByClass(modelClass);
  },

  getRecordColumnValues(model) {
    let columns = this.columnsForType(model.constructor);
    let values = {};
    columns.forEach(col => {
      values[col.name] = model.get(col.name);
    });
    return values;
{'fraction_non_alphanumeric': 0.1502911208151383, 'fraction_numerical': 0.000727802037845706, 'mean_word_length': 3.281931464174455, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '4513940', 'n_tokens_mistral': 862, 'n_tokens_neox': 838, 'n_words': 165}