<commit_before>module Ataru
  class TestConverter

    def self.convert(code_sample)

      if code_sample.nil?
        raise ArgumentError
      end

      if code_sample.code == nil || code_sample.code.size == 0
        return [:warning, code_sample]
      end

code_sample.prepared_code = code_sample.code.gsub(/(.) # ?=> (.)/, 'assert_equal \2, \1')



      # before_match = code_sample.code.match(/((.*) #=>)|((.*) # =>)/)
      # after_match = code_sample.code.match(/(# => (.*))|(#=> (.*))/)
      #
      # if before_match == nil && after_match == nil
      #   return [:nth_to_convert, code_sample]
      # end
      #
      # if before_match == nil
      #   return [:warning, code_sample]
      # end
      #
      # before = before_match[2] || before_match[4]
      # after = after_match[2] || after_match[4]
      # [:ok, "assert_equal #{after}, #{before}"]<commit_msg>Changed regex in gsub method.<commit_after>module Ataru
  class TestConverter

    def self.convert(code_sample)

      if code_sample.nil?
        raise ArgumentError
      end

      if code_sample.code == nil || code_sample.code.size == 0
        return [:warning, code_sample]
      end

code_sample.prepared_code = code_sample.code.gsub(/(\S+) # ?=> (.+)/, 'assert_equal \2, \1')



      # before_match = code_sample.code.match(/((.*) #=>)|((.*) # =>)/)
      # after_match = code_sample.code.match(/(# => (.*))|(#=> (.*))/)
      #
      # if before_match == nil && after_match == nil
      #   return [:nth_to_convert, code_sample]
      # end
      #
      # if before_match == nil
      #   return [:warning, code_sample]
      # end
      #
      # before = before_match[2] || before_match[4]
      # after = after_match[2] || after_match[4]
      # [:ok, "assert_equal #{after}, #{before}"]
{'fraction_non_alphanumeric': 0.1742296918767507, 'fraction_numerical': 0.00784313725490196, 'mean_word_length': 2.421455938697318, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4982107', 'n_tokens_mistral': 622, 'n_tokens_neox': 601, 'n_words': 113}