<commit_before># Represents a generic announcement, which may be either a system-level or instance-level one.
class GenericAnnouncement
  include ActiveModel::Model

  # @return [Array<SystemAnnouncement|Instance::Announcement>]
  def self.currently_valid
    now = Time.zone.now
    in_time_range = proc { (valid_from <= now) & (valid_to >= now) }
    system = SystemAnnouncement.includes(:creator).where(&in_time_range).order(valid_from: :desc)
    instance = Instance::Announcement.includes(:creator).where(&in_time_range).order(valid_from: :desc)
    system + instance
  end<commit_msg>Made use of currently_valid extension method<commit_after># Represents a generic announcement, which may be either a system-level or instance-level one.
class GenericAnnouncement
  include ActiveModel::Model

  # @return [Array<SystemAnnouncement|Instance::Announcement>]
  def self.currently_valid
    system = SystemAnnouncement.includes(:creator).currently_valid.order(valid_from: :desc)
    instance = Instance::Announcement.includes(:creator).currently_valid.order(valid_from: :desc)
    system + instance
  end
{'fraction_non_alphanumeric': 0.1003616636528029, 'fraction_numerical': 0.0, 'mean_word_length': 5.875776397515528, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '1191818', 'n_tokens_mistral': 324, 'n_tokens_neox': 316, 'n_words': 74}