<commit_before>class Appshot
  class EBS_Prune
    def initialize(opts={})
      @volume_id = opts[:volume_id] || ""
      @snapshots_to_keep = opts[:snapshots_to_keep] || 5
      @minimum_retention_days = opts[:minimum_retention_days] || 3
      @region                = opts[:region] unless opts[:region].nil?
      @aws_secret_access_key = opts[:aws_secret_access_key] || ""
      @aws_access_key_id     = opts[:aws_access_key_id] || ""
    end

    def call(call_chain=[])
      next_action = call_chain.shift
      prune_snapshots if valid?
      next_action.call(call_chain) unless next_action.nil?
    end

    def valid?
      raise ArgumentError.new "volume_id must be specified for an ebs_prune" if @volume_id.empty?
      raise ArgumentError.new "aws_access_key_id must be specified for an ebs_prune" if @aws_access_key_id.empty?
      raise ArgumentError.new "aws_secret_access_key must be specified for an ebs_prune" if @aws_secret_access_key.empty?
      true
    end

    private

    def ebs_volume
      options = { aws_access_key_id: @aws_access_key_id, aws_secret_access_key: @aws_secret_access_key }
      options.update( { region: @region } ) if @region
      Appshot::EBS_Volume.new(options)
    end

    def prune_snapshots
      not_after_time = Time.now - (@minimum_retention_days * 86400)
      puts "attrs in prune_snapshots: #{@snapshots_to_keep}"
      ebs_volume.prune_snapshots(@volume_id, snapshots_to_keep: @snapshots_to_keep, not_after_time: not_after_time )
    end
  end
end
<commit_msg>remove debug puts from prune<commit_after>class Appshot
  class EBS_Prune
    def initialize(opts={})
      @volume_id = opts[:volume_id] || ""
      @snapshots_to_keep = opts[:snapshots_to_keep] || 5
      @minimum_retention_days = opts[:minimum_retention_days] || 3
      @region                = opts[:region] unless opts[:region].nil?
      @aws_secret_access_key = opts[:aws_secret_access_key] || ""
      @aws_access_key_id     = opts[:aws_access_key_id] || ""
    end

    def call(call_chain=[])
      next_action = call_chain.shift
      prune_snapshots if valid?
      next_action.call(call_chain) unless next_action.nil?
    end

    def valid?
      raise ArgumentError.new "volume_id must be specified for an ebs_prune" if @volume_id.empty?
      raise ArgumentError.new "aws_access_key_id must be specified for an ebs_prune" if @aws_access_key_id.empty?
      raise ArgumentError.new "aws_secret_access_key must be specified for an ebs_prune" if @aws_secret_access_key.empty?
      true
    end

    private

    def ebs_volume
      options = { aws_access_key_id: @aws_access_key_id, aws_secret_access_key: @aws_secret_access_key }
      options.update( { region: @region } ) if @region
      Appshot::EBS_Volume.new(options)
    end

    def prune_snapshots
      not_after_time = Time.now - (@minimum_retention_days * 86400)
      ebs_volume.prune_snapshots(@volume_id, snapshots_to_keep: @snapshots_to_keep, not_after_time: not_after_time )
    end
  end
end

{'fraction_non_alphanumeric': 0.08766666666666667, 'fraction_numerical': 0.004666666666666667, 'mean_word_length': 3.5746951219512195, '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': '4645765', 'n_tokens_mistral': 1031, 'n_tokens_neox': 1007, 'n_words': 209}