<commit_before>require 'mail'

module Inbox
  class EmailsController < ApplicationController

    layout 'inbox/inbox'
    before_filter do
      @mail = params[:mail]
      @emails = Mail::TestMailer.deliveries.select{|e| Array.wrap(e.to).any?{|m| m.include?(@mail) } }.reverse
    end

    def index

    end

    def show
      @email = @emails.find{|e| e.message_id == params[:id] }
      @body_part = @email

      if @email.multipart?
        format = "." + (params[:format] || :html).to_s
        content_type = Rack::Mime.mime_type(format)
        @email.parts.each{|p| puts p.content_type  }
        @body_part = @email.parts.find { |part| part.content_type.match(content_type) } || @email.parts.first
      end
    end

    def new
      @email = Email.new()<commit_msg>remove #puts<commit_after>require 'mail'

module Inbox
  class EmailsController < ApplicationController

    layout 'inbox/inbox'
    before_filter do
      @mail = params[:mail]
      @emails = Mail::TestMailer.deliveries.select{|e| Array.wrap(e.to).any?{|m| m.include?(@mail) } }.reverse
    end

    def index

    end

    def show
      @email = @emails.find{|e| e.message_id == params[:id] }
      @body_part = @email

      if @email.multipart?
        format = "." + (params[:format] || :html).to_s
        content_type = Rack::Mime.mime_type(format)
        @body_part = @email.parts.find { |part| part.content_type.match(content_type) } || @email.parts.first
      end
    end

    def new
      @email = Email.new()
{'fraction_non_alphanumeric': 0.14276228419654716, 'fraction_numerical': 0.0, 'mean_word_length': 2.73019801980198, 'pattern_counts': {'":': 0, '<': 5, '<?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': '7138544', 'n_tokens_mistral': 532, 'n_tokens_neox': 508, 'n_words': 99}