You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: announcement_filter.rb
    path of file: ./repos/mastodon/app/models
    
    the code of the file until where you have to start completion: # frozen_string_literal: true
    
  def scope_for(key, _value)
    case key.to_s
    when 'published'
      Announcement.published
    when 'unpublished'
      Announcement.unpublished
    else
      raise Mastodon::InvalidParameterError, "Unknown filter: #{key}"
    end