<commit_before>module ShiftsHelper

  def shift_vote_collection_dates(polls)
    date_options((start_date(polls)..end_date(polls)))
  end

  def shift_recount_scrutiny_dates(polls)
    date_options(polls.map(&:ends_at).map(&:to_date).sort.inject([]) { |total, date| total << (date..date + 1.week).to_a }.flatten.uniq)
  end

  def date_options(dates)
    dates.map { |date| [l(date, format: :long), l(date)] }
  end

  def start_date(polls)
    polls.map(&:starts_at).min.to_date
  end

  def end_date(polls)
    polls.map(&:ends_at).max.to_date
  end

  def officer_select_options(officers)
    officers.collect { |officer| [officer.name, officer.id] }
  end

end<commit_msg>Excluded officer shift dates from each task date range<commit_after>module ShiftsHelper

  def shift_vote_collection_dates(polls)
    date_options((start_date(polls)..end_date(polls)), 0)
  end

  def shift_recount_scrutiny_dates(polls)
    date_options(polls.map(&:ends_at).map(&:to_date).sort.inject([]) { |total, date| total << (date..date + 1.week).to_a }.flatten.uniq, 1)
  end

  def date_options(dates, task_id)
    dates.reject { |date| officer_shifts(task_id).include?(date) }.map { |date| [l(date, format: :long), l(date)] }
  end

  def start_date(polls)
    polls.map(&:starts_at).min.to_date
  end

  def end_date(polls)
    polls.map(&:ends_at).max.to_date
  end

  def officer_select_options(officers)
    officers.collect { |officer| [officer.name, officer.id] }
  end

  private

  def officer_shifts(task_id)
    @officer.shifts.where(task: task_id).map(&:date)
  end
end
{'fraction_non_alphanumeric': 0.14249201277955273, 'fraction_numerical': 0.0025559105431309905, 'mean_word_length': 4.475524475524476, 'pattern_counts': {'":': 0, '<': 7, '<?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': '2239526', 'n_tokens_mistral': 621, 'n_tokens_neox': 600, 'n_words': 101}