<commit_before># encoding: utf-8

require 'sinatra'
require 'net/smtp'
require 'resolv'
require 'sinatra/reloader' if development?

get '/' do
  '<form action="/verify" method="post"><input type="text" name="email" /><input type="submit"/></form>'
end

post '/verify' do
  response = []
  email = params[:email]

  if valid?(email)
    id, host = email.split('@')
    mx = Resolv::DNS.new.getresources(host, Resolv::DNS::Resource::IN::MX).map { |dns| dns.exchange.to_s }

    smtp = Net::SMTP.start(mx[0], 25)
    response << smtp.helo('verify-email.io').string
    response << smtp.mailfrom('<EMAIL>').string
    begin
      response << smtp.rcptto(email).string
    rescue Net::SMTPFatalError => e
      response << e.message
    end
    smtp.finish
  else
    response << "invalid email"
  end  

  response.each do |response|
    response
  end
<commit_msg>cleaning<commit_after># encoding: utf-8

require 'sinatra'
require 'net/smtp'
require 'resolv'
require 'sinatra/reloader' if development?

get '/' do
  '<form action="/verify" method="post"><input type="text" name="email" /><input type="submit"/></form>'
end

post '/verify' do
  response = []
  email = params[:email]

  if valid?(email)
    id, host = email.split('@')
    mx = Resolv::DNS.new.getresources(host, Resolv::DNS::Resource::IN::MX).map { |dns| dns.exchange.to_s }

    smtp = Net::SMTP.start(mx[0], 25)
    response << smtp.helo('verify-email.io').string
    response << smtp.mailfrom('<EMAIL>').string
    begin
      response << smtp.rcptto(email).string
    rescue Net::SMTPFatalError => e
      response << e.message
    end
    smtp.finish
  else
    response << "invalid email"
  end  

{'fraction_non_alphanumeric': 0.16976604679064186, 'fraction_numerical': 0.004799040191961607, 'mean_word_length': 3.6077348066298343, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 15, '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': '7066290', 'n_tokens_mistral': 590, 'n_tokens_neox': 586, 'n_words': 127}