<commit_before>import Ember from 'ember';
import CpPanelBodyComponent from 'ember-collapsible-panel/components/cp-panel-body';
import PreprintFormFieldMixin from '../mixins/preprint-form-field';

export default CpPanelBodyComponent.extend(PreprintFormFieldMixin, {
    store: Ember.inject.service(),
    filter: [{}, {}, {}],
    updateFilteredPath() {
        var _this = this;
        var overallPath = []
        var paths = this.get('path').slice(0, 2);
        if (paths.length === 1) {
            _this.get('store').query('taxonomy', { filter: { parent_ids: paths[0].id}, page: {size: 100} }).then(
                results => {Ember.set(paths[0], 'children', results.map(
                    result => {return {name: result.get('text'), id: result.id}}
                ))
                overallPath.push(paths[0]);
                _this.set('filteredPath', overallPath);
                }
            );
        } else if (paths.length === 2) {
            _this.get('store').query('taxonomy', { filter: { parent_ids: paths[0].id}, page: {size: 100} }).then(
                results => {Ember.set(paths[0], 'children', results.map(
                    result => {return {name: result.get('text'), id: result.id}}
                ))
                overallPath.push(paths[0]);
                _this.get('store').query('taxonomy', { filter: { parent_ids: paths[1].id}, page: {size: 100} }).then(
                    results => {Ember.set(paths[1], 'children', results.map(
                        result => {return {name: result.get('text'), id: result.id}}
                    ))
                    overallPath.push(paths[1]);
                    _this.set('filteredPath', overallPath);
                    }
                );
                }
            );
        }
    },
    filteredPath: Ember.computed('path', 'changeFlag', 'filter', 'filter.@each.value', function() {
        this.updateFilteredPath();
    }),
    sortedTaxonomies: Ember.computed('taxonomies', 'filter', 'filter.0.value', function() {
        var self = this;
        this.get('store').query('taxonomy', { filter: { parent_ids: 'null'}, page: {size: 100} }).then(results => {
            self.set('sortedTaxonomies', results.map( result => {
                return {name: result.get('text'), id: result.get('id')};
            }));
        });
    }),
    path: [],
    selected: new Ember.Object(),
    sortedSelection: Ember.computed('selected', function() {
        const sorted = [];
        const selected = this.get('selected');
        const flatten = ([obj, name = []]) => {<commit_msg>clean up lint<commit_after>import Ember from 'ember';
import CpPanelBodyComponent from 'ember-collapsible-panel/components/cp-panel-body';
import PreprintFormFieldMixin from '../mixins/preprint-form-field';

export default CpPanelBodyComponent.extend(PreprintFormFieldMixin, {
    store: Ember.inject.service(),
    filter: [{}, {}, {}],
    updateFilteredPath() {
        var _this = this;
        var overallPath = [];
        var paths = this.get('path').slice(0, 2);
        if (paths.length === 1) {
            _this.get('store').query('taxonomy', { filter: { parent_ids: paths[0].id}, page: {size: 100} }).then(results => {
                Ember.set(paths[0], 'children', results.map(
                    result => {return {name: result.get('text'), id: result.id};}
                ));
                overallPath.push(paths[0]);
                _this.set('filteredPath', overallPath);
            });
        } else if (paths.length === 2) {
            _this.get('store').query('taxonomy', { filter: { parent_ids: paths[0].id}, page: {size: 100} }).then(results => {
                Ember.set(paths[0], 'children', results.map(
                    result => {return {name: result.get('text'), id: result.id};}
                ));
                overallPath.push(paths[0]);
                _this.get('store').query('taxonomy', { filter: { parent_ids: paths[1].id}, page: {size: 100} }).then(results => {
                    Ember.set(paths[1], 'children', results.map(
                        result => {return {name: result.get('text'), id: result.id};}
                    ));
                    overallPath.push(paths[1]);
                    _this.set('filteredPath', overallPath);
                });
            });
        }
    },
    filteredPath: Ember.computed('path', 'changeFlag', 'filter', 'filter.@each.value', function() {
        this.updateFilteredPath();
    }),
    sortedTaxonomies: Ember.computed('taxonomies', 'filter', 'filter.0.value', function() {
        var self = this;
        this.get('store').query('taxonomy', { filter: { parent_ids: 'null'}, page: {size: 100} }).then(results => {
            self.set('sortedTaxonomies', results.map( result => {
                return {name: result.get('text'), id: result.get('id')};
            }));
        });
    }),
    path: [],
    selected: new Ember.Object(),
    sortedSelection: Ember.computed('selected', function() {
        const sorted = [];
        const selected = this.get('selected');
        const flatten = ([obj, name = []]) => {
{'fraction_non_alphanumeric': 0.1766431924882629, 'fraction_numerical': 0.010172143974960876, 'mean_word_length': 2.1253056234718826, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '2965090', 'n_tokens_mistral': 1519, 'n_tokens_neox': 1457, 'n_words': 285}