<commit_before>class Zone < ActiveResource::Base
  
  def domain
    origin.sub(/\.$/,'')
  end
  
  def self.create_for_domain(domain)
    $LOG.info "> domain record doesn't exist yet, creating" if $LOG
    zone = self.new(:origin => "#{domain}.")
    zone.save
    zone
  end
  
  def new_record(attrs={})
    Record.new(attrs.merge({:zone_id => id}))
  end
  
end<commit_msg>Method to look up zones by name.<commit_after>class Zone < ActiveResource::Base
  
  def domain
    origin.sub(/\.$/,'')
  end
  
  def self.create_for_domain(domain)
    $LOG.info "> domain record doesn't exist yet, creating" if $LOG
    zone = self.new(:origin => "#{domain}.")
    zone.save
    zone
  end
  
  def self.find_by_domain(domain)
    Zone.find(:all, :params => { :origin => domain })
  end
  
  def new_record(attrs={})
    Record.new(attrs.merge({:zone_id => id}))
  end

end
{'fraction_non_alphanumeric': 0.1528735632183908, 'fraction_numerical': 0.0, 'mean_word_length': 2.9954128440366974, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '2424723', 'n_tokens_mistral': 307, 'n_tokens_neox': 302, 'n_words': 72}