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: policy_sets.rb
    path of file: ./repos/manageiq/lib/task_helpers/exports
    
    the code of the file until where you have to start completion: module TaskHelpers
  class Exports
    class PolicySets
      def export(options = {})
        export_dir = options[:directory]

        policy_sets = options[:all] ? MiqPolicySet.all : MiqPolicySet.where(:read_only => [false, nil])

        policy_sets.order(:id).each do |policy_set|
          $log.info("Exporting Policy Profi
    
      def export(options = {})
        export_dir = options[:directory]

        policy_sets = options[:all] ? MiqPolicySet.all : MiqPolicySet.where(:read_only => [false, nil])

        policy_sets.order(:id).each do |policy_set|
          $log.info("Exporting Policy Profile: #{policy_set.description} (ID: #{policy_set.id})")

          filename = Exports.safe_filename(policy_set.description, options[:keep_spaces])
          File.write("#{export_dir}/#{filename}.yaml", policy_set.export_to_yaml)
        end
      end