<commit_before>class Feed
  # What students should be shown in an educator's feed?
  # This isn't always exactly the same as "who is this educator authorized
  # to view?"
  def self.students_for_feed(educator)
    # Start with all students they are authorized to view
    authorizer = Authorizer.new(educator)
    authorized_students = authorizer.authorized { Student.active.select(:counselor) }

    # Filter by role (eg, for HS counselors caseload)
    FeedFilter.new(educator).filter_for_educator(authorized_students)
  end

  def initialize(authorized_students)
    @authorized_students = authorized_students
  end

  # Return everything, with all the default options.
  #
  # Query for different kinds of feed cards, then merge and sort and truncate.
  # This means we'll always slightly overquery, since we don't know how many
  # different bits of information there are across data sources until
  # we query and combine them. Ideally we'd query in parallel but we'd
  # need to push this out to the client to do that (and still would have to
  # delay rendering until both came back and were merged anyway).
  def all_cards(time_now, limit)<commit_msg>And select for house in feed query<commit_after>class Feed
  # What students should be shown in an educator's feed?
  # This isn't always exactly the same as "who is this educator authorized
  # to view?"
  def self.students_for_feed(educator)
    # Start with all students they are authorized to view
    authorizer = Authorizer.new(educator)
    authorized_students = authorizer.authorized do
      Student.active.select(:counselor, :house) # these are fetching for FeedFilter below
    end

    # Filter by role (eg, for HS counselors caseload)
    FeedFilter.new(educator).filter_for_educator(authorized_students)
  end

  def initialize(authorized_students)
    @authorized_students = authorized_students
  end

  # Return everything, with all the default options.
  #
  # Query for different kinds of feed cards, then merge and sort and truncate.
  # This means we'll always slightly overquery, since we don't know how many
  # different bits of information there are across data sources until
  # we query and combine them. Ideally we'd query in parallel but we'd
  # need to push this out to the client to do that (and still would have to
  # delay rendering until both came back and were merged anyway).
  def all_cards(time_now, limit)
{'fraction_non_alphanumeric': 0.05610972568578554, 'fraction_numerical': 0.0, 'mean_word_length': 4.046121593291405, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4774496', 'n_tokens_mistral': 672, 'n_tokens_neox': 639, 'n_words': 292}