<commit_before>import $ from 'jquery';
import { later, schedule } from '@ember/runloop';
import { computed, get, set, setProperties } from '@ember/object';
import { equal, alias } from '@ember/object/computed';
import { inject as service } from '@ember/service';
import Controller from '@ember/controller';
import { on } from '@ember/object/evented';

export default Controller.extend({
  queryParams       : ['errorMsg', 'resetPassword', 'errorCode'],
  access            : service(),
  settings          : service(),
  intl              : service(),
  globalStore:        service(),
  modalService:       service('modal'),

  isGithub          : computed('access.providers', function() {
    let gh = get(this, 'access.providers').findBy('id', 'github');
    return gh && get(gh, 'enabled');
  }),
  isActiveDirectory : computed('access.provider', function() {
    return get(this, 'access.providers').findBy('id', 'activedirectory');
  }),
  isOpenLdap        : computed('access.provider',  function() {
    return get(this, 'access.providers').findBy('id', 'openldapconfig');
  }),

  isLocal: true,
  onlyLocal: computed('access.providers.@each.id', function() {
    const providers = (get(this, 'access.providers')||[]).filter(x => x.id !== 'local');
    return get(providers, 'length') === 0;
  }),

  isAzureAd         : computed('access.provider', function() {
    return get(this, 'access.providers').findBy('id', 'azureadconfig');
  }),
  isShibboleth      : computed('access.provider', function() {
    return get(this, 'access.providers').findBy('id', 'shibbolethconfig');
  }),
  isCaas            : computed('app.mode', function() {
    return get(this, 'app.mode') === 'caas' ? true : false;
  }),

  authCount         : computed('access.providers', function() {
    return get(this, 'access.providers.length') === 1;
  }),
  promptPasswordReset: alias('resetPassword'),

  waiting           : false,
  errorMsg          : null,
  errorCode         : null,
  changePassword    : false,
  resetPassword     : <PASSWORD>,
  isForbidden       : equal('errorCode', '403'),
  code              : null,

  router: service(),
  actions: {
    started() {
      setProperties(this, {
        'waiting': true,
        'errorMsg': null,
      });
    },

    complete(success) {
      if (success) {
        set(this, 'code', null);
        get(this, 'router').replaceWith('authenticated');
      }<commit_msg>Cleanup<commit_after>import $ from 'jquery';
import { later, schedule } from '@ember/runloop';
import { computed, get, set, setProperties } from '@ember/object';
import { equal, alias } from '@ember/object/computed';
import { inject as service } from '@ember/service';
import Controller from '@ember/controller';
import { on } from '@ember/object/evented';

export default Controller.extend({
  queryParams       : ['errorMsg', 'resetPassword', 'errorCode'],
  access            : service(),
  settings          : service(),
  intl              : service(),
  globalStore:        service(),
  modalService:       service('modal'),

  isGithub          : computed('access.providers', function() {
    let gh = get(this, 'access.providers').findBy('id', 'github');
    return gh && get(gh, 'enabled');
  }),
  isActiveDirectory : computed('access.provider', function() {
    return get(this, 'access.providers').findBy('id', 'activedirectory');
  }),
  isOpenLdap        : computed('access.provider',  function() {
    return get(this, 'access.providers').findBy('id', 'openldapconfig');
  }),

  isLocal: true,
  onlyLocal: computed('access.providers.@each.id', function() {
    const providers = (get(this, 'access.providers')||[]).filter(x => x.id !== 'local');
    return get(providers, 'length') === 0;
  }),

  isAzureAd         : computed('access.provider', function() {
    return get(this, 'access.providers').findBy('id', 'azureadconfig');
  }),
  isShibboleth      : computed('access.provider', function() {
    return get(this, 'access.providers').findBy('id', 'shibbolethconfig');
  }),
  isCaas            : computed('app.mode', function() {
    return get(this, 'app.mode') === 'caas' ? true : false;
  }),

  promptPasswordReset: alias('resetPassword'),

  waiting           : false,
  errorMsg          : null,
  errorCode         : null,
  changePassword    : false,
  resetPassword     : false,
  isForbidden       : equal('errorCode', '403'),
  code              : null,

  router: service(),
  actions: {
    started() {
      setProperties(this, {
        'waiting': true,
        'errorMsg': null,
      });
    },

    complete(success) {
      if (success) {
        set(this, 'code', null);
        get(this, 'router').replaceWith('authenticated');
      }
{'fraction_non_alphanumeric': 0.17099659284497445, 'fraction_numerical': 0.0019165247018739352, 'mean_word_length': 3.0807993049522153, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 6, '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': '110386', 'n_tokens_mistral': 1414, 'n_tokens_neox': 1387, 'n_words': 305}