<commit_before>define :s3manage, :bucket => nil, :s3file => nil, :action => nil do

  unless [ "upload", "download" ].include?("#{params[:action]}")
    raise ArgumentError, "Unsupported action: #{params[:action]}"
  end

  unless ::File.exists?("#{params[:name]}")
    raise ArgumentError, "No such file or directory: #{params[:name]}"    
  end

  case params[:action]
    when "upload"    
      unless ::File.exists?("#{params[:name]}")
        raise ArgumentError, "No such file: #{params[:name]}"
      end
      ruby_block "s3upload" do
        block do
          require 'rubygems'
          require 'yaml'
          require 'aws-sdk'

          s3 = AWS::S3.new(
            :access_key_id     => "#{node[:s3manage][:access_key_id]}",
            :secret_access_key => "#{node[:s3manage][:secret_access_key]}")

          base_name = File.basename("#{params[:name]}")

          unless s3.buckets["#{params[:bucket]}"].exists?
            raise ArgumentError, "No such bucket: #{params[:bucket]}"<commit_msg>Removed legacy folder existing check<commit_after>define :s3manage, :bucket => nil, :s3file => nil, :action => nil do

  unless [ "upload", "download" ].include?("#{params[:action]}")
    raise ArgumentError, "Unsupported action: #{params[:action]}"
  end
  
  case params[:action]
    when "upload"    
      unless ::File.exists?("#{params[:name]}")
        raise ArgumentError, "No such file: #{params[:name]}"
      end
      ruby_block "s3upload" do
        block do
          require 'rubygems'
          require 'yaml'
          require 'aws-sdk'

          s3 = AWS::S3.new(
            :access_key_id     => "#{node[:s3manage][:access_key_id]}",
            :secret_access_key => "#{node[:s3manage][:secret_access_key]}")

          base_name = File.basename("#{params[:name]}")

          unless s3.buckets["#{params[:bucket]}"].exists?
            raise ArgumentError, "No such bucket: #{params[:bucket]}"
{'fraction_non_alphanumeric': 0.17071908949818934, 'fraction_numerical': 0.008277289187790998, 'mean_word_length': 2.930894308943089, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1872891', 'n_tokens_mistral': 612, 'n_tokens_neox': 595, 'n_words': 132}