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: availability.rb
    path of file: ./repos/kontena/server/app/services/scheduler/filter
    
    the code of the file until where you have to start completion: module Scheduler
  module Filter
    class Availability

    
      def for_service(service, instance_number, nodes)

        nodes = nodes.select { |n|
          case n.availability
          when HostNode::Availability::ACTIVE
            true
          when HostNode::Availability::DRAIN
            false
          end