<commit_before>// @ngInject
export function stateUtilsService($state) {
  var vm = this;

  vm.setPrevState = function(state, params) {
    if (state.data && state.data.workspace && state.data.workspace !== 'user') {
      vm.prevState = state;
      vm.prevParams = params;
      vm.prevWorkspace = state.data.workspace;
    }
  };

  vm.getPrevWorkspace = function() {
    return vm.prevWorkspace;
  };

  vm.goBack = function() {
    if (vm.prevState) {
      $state.go(vm.prevState, vm.prevParams);
    }
  };
}

// @ngInject
export function attachStateUtils($rootScope, stateUtilsService) {
  $rootScope.$on('$stateChangeSuccess', function(event, toState, toParams, fromState, fromParams) {
    stateUtilsService.setPrevState(fromState, fromParams);
  });
}

// @ngInject
export function attachInvitationUtils($rootScope, invitationService, ncUtilsFlash) {
  $rootScope.$on('authService:signin', function() {
      var token = invitationService.getInvitationToken();
      if (token) {
        invitationService.accept(token).then(function() {
          ncUtilsFlash.success('Your invitation was accepted');
          invitationService.clearInvitationToken();
        }, function(response) {
          if (response.status === 400) {
            ncUtilsFlash.error('Invitation is invalid');
          } else {
            ncUtilsFlash.error('Unable to accept invitation');
          }
          invitationService.clearInvitationToken();
        });
      }
  });
}
<commit_msg>Indentation fixes<commit_after>// @ngInject
export function stateUtilsService($state) {
  var vm = this;

  vm.setPrevState = function(state, params) {
    if (state.data && state.data.workspace && state.data.workspace !== 'user') {
      vm.prevState = state;
      vm.prevParams = params;
      vm.prevWorkspace = state.data.workspace;
    }
  };

  vm.getPrevWorkspace = function() {
    return vm.prevWorkspace;
  };

  vm.goBack = function() {
    if (vm.prevState) {
      $state.go(vm.prevState, vm.prevParams);
    }
  };
}

// @ngInject
export function attachStateUtils($rootScope, stateUtilsService) {
  $rootScope.$on('$stateChangeSuccess', function(event, toState, toParams, fromState, fromParams) {
    stateUtilsService.setPrevState(fromState, fromParams);
  });
}

// @ngInject
export function attachInvitationUtils($rootScope, invitationService, ncUtilsFlash) {
  $rootScope.$on('authService:signin', function() {
    var token = invitationService.getInvitationToken();
    if (token) {
      invitationService.accept(token).then(function() {
        ncUtilsFlash.success('Your invitation was accepted');
        invitationService.clearInvitationToken();
      }, function(response) {
        if (response.status === 400) {
          ncUtilsFlash.error('Invitation is invalid');
        } else {
          ncUtilsFlash.error('Unable to accept invitation');
        }
        invitationService.clearInvitationToken();
      });
    }
  });
}

{'fraction_non_alphanumeric': 0.13342409802586794, 'fraction_numerical': 0.0020422055820285907, 'mean_word_length': 3.2594202898550724, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7642058', 'n_tokens_mistral': 875, 'n_tokens_neox': 865, 'n_words': 155}