<commit_before>/************************************************
 * AUTHOR:         <NAME>             *
 * CREATION_DATE:  22/11/16                      *
 * EMAIL:          <EMAIL>   *
 * LICENSE:        Apache 2.0                   *
 ***********************************************/
'use strict';

var app = angular.module('facilitation');

app.controller('instanceCtrl', function (LabelsService, $scope, EventsService, $routeParams, $http, socket, Auth, $location) {

    /**
     * Remove the workshop from the user's instances
     * @type {deleteInstance}
     */
    $scope.deleteInstance = deleteInstance;

    /**
     * Display the instance feedback QRCode
     * @type {afficherQrcode}
     */
    $scope.afficherQrcode = afficherQrcode;

    /**
     * Hide/display feedback
     * @type {focusFeedback}
     */
    $scope.focusFeedback= focusFeedback;

    /**
     * Return the label color
     * @type {getLabelColorFct}
     */
    $scope.getLabelColor = getLabelColorFct;

    var currentId = $routeParams.idInstance;
    $scope.workshopInstance = "";

    if (!Auth.isConnected()) {
        $location.path("/");
        $scope.$emit('notify', {
            type: 'error',
            title: 'Vous n\'avez pas les autorisations d\'accéder à cette page'
        });
    }

    EventsService.getWorkshopInstance(currentId).then(function (dataResponse) {
        $scope.workshopInstance = dataResponse.data.data;

        var timingArray = $scope.workshopInstance.steps.map(function(step, index){
            var stepArray = $scope.workshopInstance.steps.slice(0, index);
            return stepArray.reduce(function (accumulateur, currentStep) {
                var tmp = 0;
                if(currentStep.duration.theorical) {
                    tmp = currentStep.duration.theorical;
                }
                return accumulateur + tmp;

            }, 0);
        });

        for(var i = 0; i<timingArray.length; i++) {
            var d = new Date(timingArray[i] * 60000);<commit_msg>[DEV #115] fixed<commit_after>/************************************************
 * AUTHOR:         <NAME>             *
 * CREATION_DATE:  22/11/16                      *
 * EMAIL:          <EMAIL>   *
 * LICENSE:        Apache 2.0                   *
 ***********************************************/
'use strict';

var app = angular.module('facilitation');

app.controller('instanceCtrl', function (LabelsService, $scope, EventsService, $routeParams, $http, socket, Auth, $location) {

    /**
     * Remove the workshop from the user's instances
     * @type {deleteInstance}
     */
    $scope.deleteInstance = deleteInstance;

    /**
     * Display the instance feedback QRCode
     * @type {afficherQrcode}
     */
    $scope.afficherQrcode = afficherQrcode;

    /**
     * Hide/display feedback
     * @type {focusFeedback}
     */
    $scope.focusFeedback= focusFeedback;

    /**
     * Return the label color
     * @type {getLabelColorFct}
     */
    $scope.getLabelColor = getLabelColorFct;

    var currentId = $routeParams.idInstance;
    $scope.workshopInstance = "";

    EventsService.getWorkshopInstance(currentId).then(function (dataResponse) {
        $scope.workshopInstance = dataResponse.data.data;

        var timingArray = $scope.workshopInstance.steps.map(function(step, index){
            var stepArray = $scope.workshopInstance.steps.slice(0, index);
            return stepArray.reduce(function (accumulateur, currentStep) {
                var tmp = 0;
                if(currentStep.duration.theorical) {
                    tmp = currentStep.duration.theorical;
                }
                return accumulateur + tmp;

            }, 0);
        });

        for(var i = 0; i<timingArray.length; i++) {
            var d = new Date(timingArray[i] * 60000);
{'fraction_non_alphanumeric': 0.16448058761804826, 'fraction_numerical': 0.009706190975865687, 'mean_word_length': 2.2258883248730963, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '6644769', 'n_tokens_mistral': 1120, 'n_tokens_neox': 1049, 'n_words': 215}