<commit_before>export default Ember.Controller.extend({
  isMultiple: Ember.computed.equal("signup.type", "multiple"),
  isNumber: Ember.computed.equal("signup.type", "number"),
  isRandom : Ember.computed.equal("signup.order", "random"),
  isClosed: Ember.computed.equal("signup.status", "closed"),

  // shows the results when
  //   - signup is closed
  //   - topic is archived/closed
  //   - user wants to see the results
  showingResults: Em.computed.or("isClosed", "post.topic.closed", "post.topic.archived", "showResults"),

  showResultsDisabled: Em.computed.equal("signup.voters", 0),
  hideResultsDisabled: Em.computed.alias("isClosed"),

  signup: function() {
    const signup = this.get("model"),
          vote = this.get("vote");

    if (signup) {
      const options = _.map(signup.get("options"), o => Em.Object.create(o));

      if (vote) {
        options.forEach(o => o.set("selected", vote.indexOf(o.get("id")) >= 0));
      }

      signup.set("options", options);
    }

    return signup;
  }.property("model"),

  selectedOptions: function() {
    return _.map(this.get("signup.options").filterBy("selected"), o => o.get("id"));
  }.property("signup.options.@each.selected"),

  min: function() {
    let min = parseInt(this.get("signup.min"), 10);
    if (isNaN(min) || min < 1) { min = 1; }
    return min;
  }.property("signup.min"),

  max: function() {
    let options = this.get("signup.options.length"),
        max = parseInt(this.get("signup.max"), 10);
    if (isNaN(max) || max > options) { max = options; }
    return max;
  }.property("signup.max", "signup.options.length"),

  votersText: function() {
    return I18n.t("signup.voters", { count: this.get("signup.voters") });
  }.property("signup.voters"),

  totalVotes: function() {<commit_msg>Show results if the user has voted<commit_after>export default Ember.Controller.extend({
  isMultiple: Ember.computed.equal("signup.type", "multiple"),
  isNumber: Ember.computed.equal("signup.type", "number"),
  isRandom : Ember.computed.equal("signup.order", "random"),
  isClosed: Ember.computed.equal("signup.status", "closed"),
  hasVoted: Ember.computed.gt("numSelectedOptions", 0),

  // shows the results when
  //   - signup is closed
  //   - topic is archived/closed
  //   - user wants to see the results
  showingResults: Em.computed.or("isClosed", "post.topic.closed", "post.topic.archived", "showResults", "hasVoted"),

  showResultsDisabled: Em.computed.equal("signup.voters", 0),
  hideResultsDisabled: Em.computed.alias("isClosed"),

  signup: function() {
    const signup = this.get("model"),
          vote = this.get("vote");

    if (signup) {
      const options = _.map(signup.get("options"), o => Em.Object.create(o));

      if (vote) {
        options.forEach(o => o.set("selected", vote.indexOf(o.get("id")) >= 0));
      }

      signup.set("options", options);
    }

    return signup;
  }.property("model"),

  selectedOptions: function() {
    return _.map(this.get("signup.options").filterBy("selected"), o => o.get("id"));
  }.property("signup.options.@each.selected"),
  
  numSelectedOptions: this.get("signup.options").filterBy("selected").length,

  min: function() {
    let min = parseInt(this.get("signup.min"), 10);
    if (isNaN(min) || min < 1) { min = 1; }
    return min;
  }.property("signup.min"),

  max: function() {
    let options = this.get("signup.options.length"),
        max = parseInt(this.get("signup.max"), 10);
    if (isNaN(max) || max > options) { max = options; }
    return max;
  }.property("signup.max", "signup.options.length"),

  votersText: function() {
    return I18n.t("signup.voters", { count: this.get("signup.voters") });
  }.property("signup.voters"),

  totalVotes: function() {
{'fraction_non_alphanumeric': 0.18890074706510138, 'fraction_numerical': 0.005602988260405549, 'mean_word_length': 3.639851485148515, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '2391700', 'n_tokens_mistral': 1299, 'n_tokens_neox': 1249, 'n_words': 242}