<commit_before>require 'rom/commands'
require 'rom/commands/create'

module ROM
  module S3
    module Commands
      class Create < ROM::Commands::Create
        adapter :s3

        def execute(tuples)
          tuples.each do |tuple|
            entity_extension = set_extension(tuple[:entity_extension])
            obj = relation.dataset.object("#{relation.dataset.key_prefix}/#{tuple[:entity_type]}/#{tuple[:entity_id]}" + entity_extension)
            obj.put(body: tuple[:entity_body])
          end
        end

        def set_extension(extension)
          ext = '.txt'
          if extension && extension.size > 0
            ext = extension
          end
          ext
        end
      end
    end
  end
end
<commit_msg>add return to methods<commit_after>require 'rom/commands'
require 'rom/commands/create'

module ROM
  module S3
    module Commands
      class Create < ROM::Commands::Create
        adapter :s3

        def execute(tuples)
          tuples.map do |tuple|
            entity_extension = set_extension(tuple[:entity_extension])
            object_name = "#{relation.dataset.key_prefix}/#{tuple[:entity_type]}/#{tuple[:entity_id]}" + entity_extension
            obj = relation.dataset.object(object_name)
            obj.put(body: tuple[:entity_body])
            object_name
          end
        end

        def set_extension(extension)
          ext = '.txt'
          if extension && extension.size > 0
            ext = extension
          end
          ext
        end
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.09433962264150944, 'fraction_numerical': 0.003903708523096942, 'mean_word_length': 1.9806201550387597, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '493679', 'n_tokens_mistral': 427, 'n_tokens_neox': 422, 'n_words': 98}