<commit_before>class SubmissionRepository
  ACCEPTED_THRESHOLD = 3
  WAITLIST_THRESHOLD = 2

  def accepted
    Submission.joins(:rates).group('submissions.id').having('avg(value) >= ?', ACCEPTED_THRESHOLD).to_a
  end

  def waitlist
    Submission.joins(:rates).group('submissions.id').having('avg(value) < ? AND avg(value) >= ?', ACCEPTED_THRESHOLD,
    WAITLIST_THRESHOLD).to_a
  end

  def unaccepted
    Submission.joins(:rates).group('submissions.id').having('avg(value) < ?', WAITLIST_THRESHOLD).to_a
  end
end<commit_msg>Discard submissions where rejected equals true in accepted and waitlist queries<commit_after>class SubmissionRepository
  ACCEPTED_THRESHOLD = 3
  WAITLIST_THRESHOLD = 2

  def accepted
    Submission.where(rejected: false).joins(:rates).group('submissions.id').having('avg(value) >= ?', ACCEPTED_THRESHOLD).to_a
  end

  def waitlist
    Submission.where(rejected: false).joins(:rates).group('submissions.id').having('avg(value) < ? AND avg(value) >= ?',
    ACCEPTED_THRESHOLD, WAITLIST_THRESHOLD).to_a
  end

  def unaccepted
    Submission.joins(:rates).group('submissions.id').having('avg(value) < ?', WAITLIST_THRESHOLD).to_a
  end
end
{'fraction_non_alphanumeric': 0.13504273504273503, 'fraction_numerical': 0.003418803418803419, 'mean_word_length': 5.398907103825136, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '3300416', 'n_tokens_mistral': 446, 'n_tokens_neox': 416, 'n_words': 61}