<commit_before>class ElectionsController < ApplicationController
  def index
    range = Date.today..1.year.from_now.to_date
    @elections = Election.where("start_date >= ?",Date.today) + ElectionSchedule.within(range)

    respond_to do |format|
      format.html
      format.json {
        render json: @elections
      }
      format.csv {
        send_data Election.to_csv(@elections), filename: 'comingelections.csv', type: 'text/csv; charset=utf-8; header=present'
      }
    end
  end
end<commit_msg>use Election#within<commit_after>class ElectionsController < ApplicationController
  def index
    range = Date.today..1.year.from_now.to_date
    @elections = Election.within(range) + ElectionSchedule.within(range)

    respond_to do |format|
      format.html
      format.json {
        render json: @elections
      }
      format.csv {
        send_data Election.to_csv(@elections), filename: 'comingelections.csv', type: 'text/csv; charset=utf-8; header=present'
      }
    end
  end
end
{'fraction_non_alphanumeric': 0.10756972111553785, 'fraction_numerical': 0.00398406374501992, 'mean_word_length': 3.1358024691358026, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, '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': '658120', 'n_tokens_mistral': 322, 'n_tokens_neox': 303, 'n_words': 61}