<commit_before>require 'net/telnet'

module MailBoxValidator
  class MailBox
    include Singleton

    def valid?(mail_address)
      domain = mail_address.slice(/@(.*)/, 1)
      mx = mail_exchanger_record_for(domain)
      return false unless mx.present?
      mx.all? {|host| response_for(mail_address, host).match(/^2\d{2}/).present? }
    end

    private<commit_msg>cool code<commit_after>require 'net/telnet'

module MailBoxValidator
  class MailBox
    include Singleton

    def valid?(mail_address)
      domain = mail_address.slice(/@(.*)/, 1)
      mx = mail_exchanger_record_for(domain)
      mx.present? && mx.all?(&return_valid?)
    end

    private

    def return_valid?
      Proc.new do |host|
        response_for(mail_address, host).match(/^2\d{2}/).present?
      end
    end
{'fraction_non_alphanumeric': 0.12265331664580725, 'fraction_numerical': 0.007509386733416771, 'mean_word_length': 3.0609137055837565, 'pattern_counts': {'":': 0, '<': 3, '<?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': '801017', 'n_tokens_mistral': 275, 'n_tokens_neox': 267, 'n_words': 53}