<commit_before>import {Experiment} from './experiment/components/tasks/experiment.model';

angular.module('materialscommons').component('mcProjectExperiments', {
    templateUrl: 'app/project/experiments/mc-project-experiments.html',
    controller: MCProjectExperimentsComponentController,
    bindings: {
        experiments: '='
    }
});

/*@ngInject*/
function MCProjectExperimentsComponentController($mdDialog, $state) {
    let ctrl = this;
    ctrl.showTableView = true;
    ctrl.startNewExperiment = () => {
        $mdDialog.show({
            templateUrl: 'app/project/experiments/create-experiment-dialog.html',
            controller: CreateNewExperimentDialogController,
            controllerAs: 'ctrl',
            bindToController: true
        }).then(
            (e) => {
                $state.go('project.experiment.details', {experiment_id: e.id});
            }
        );
    };
}

class CreateNewExperimentDialogController {
    /*@ngInject*/
    constructor($mdDialog, experimentsService, $stateParams, toast) {
        this.$mdDialog = $mdDialog;
        this.name = '';
        this.description = '';
        this.projectID = $stateParams.project_id;
        this.experimentsService = experimentsService;
        this.toast = toast;
    }

    submit() {
        if (this.name === '') {
            this.toast.error('You must supply an experiment name');
            return;
        }
        let e = new Experiment(this.name);
        e.description = this.description;
        this.experimentsService.createForProject(this.projectID, e).then(
            (createdExperiment) => {
                this.$mdDialog.hide(createdExperiment)
            },
            (error) => {
                console.log('create experiment failed', error);
            });
    }

    cancel() {
        this.$mdDialog.cancel();
    }
}


<commit_msg>Remove extra spaces at end of file.<commit_after>import {Experiment} from './experiment/components/tasks/experiment.model';

angular.module('materialscommons').component('mcProjectExperiments', {
    templateUrl: 'app/project/experiments/mc-project-experiments.html',
    controller: MCProjectExperimentsComponentController,
    bindings: {
        experiments: '='
    }
});

/*@ngInject*/
function MCProjectExperimentsComponentController($mdDialog, $state) {
    let ctrl = this;
    ctrl.showTableView = true;
    ctrl.startNewExperiment = () => {
        $mdDialog.show({
            templateUrl: 'app/project/experiments/create-experiment-dialog.html',
            controller: CreateNewExperimentDialogController,
            controllerAs: 'ctrl',
            bindToController: true
        }).then(
            (e) => {
                $state.go('project.experiment.details', {experiment_id: e.id});
            }
        );
    };
}

class CreateNewExperimentDialogController {
    /*@ngInject*/
    constructor($mdDialog, experimentsService, $stateParams, toast) {
        this.$mdDialog = $mdDialog;
        this.name = '';
        this.description = '';
        this.projectID = $stateParams.project_id;
        this.experimentsService = experimentsService;
        this.toast = toast;
    }

    submit() {
        if (this.name === '') {
            this.toast.error('You must supply an experiment name');
            return;
        }
        let e = new Experiment(this.name);
        e.description = this.description;
        this.experimentsService.createForProject(this.projectID, e).then(
            (createdExperiment) => {
                this.$mdDialog.hide(createdExperiment)
            },
            (error) => {
                console.log('create experiment failed', error);
            });
    }

    cancel() {
        this.$mdDialog.cancel();
    }
}
{'fraction_non_alphanumeric': 0.1274378840502271, 'fraction_numerical': 0.0, 'mean_word_length': 2.29287598944591, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '140690', 'n_tokens_mistral': 1016, 'n_tokens_neox': 1006, 'n_words': 164}