<commit_before># encoding: utf-8
module FreeberryAuth
  class Account < ::ActiveRecord::Base
    validates_presence_of :identifier, :provider_name
  
    attr_accessible :name, :username, :photo, :identity, :identifier, :email, 
                    :provider, :provider_name, :address, :uid, :language, :gender
    
    before_validation :make_defaults
    
    def identity=(value)
      self.identifier = value
    end
    
    def provider=(value)
      self.provider_name = value
    end
    
    def nickname=(value)
      self.username = value
    end
    
    def name=(value)
      str = value.is_a?(Hash) && value.has_key?('full_name') ? value['full_name'] : value
      write_attribute(:name, str)
    end
    
    def dob=(value)
      self.birthday = value
    end
    <commit_msg>Add helper methods for account<commit_after># encoding: utf-8
module FreeberryAuth
  class Account < ::ActiveRecord::Base
    validates_presence_of :identifier, :provider_name
  
    attr_accessible :name, :username, :photo, :identity, :identifier, :email, 
                    :provider, :provider_name, :address, :uid, :language, :gender
    
    before_validation :make_defaults
    
    def identity=(value)
      self.identifier = value
    end
    
    def provider=(value)
      self.provider_name = value
    end
    
    def nickname=(value)
      self.username = value
    end
    
    def name=(value)
      str = value.is_a?(Hash) && value.has_key?('full_name') ? value['full_name'] : value
      write_attribute(:name, str)
    end
    
    def dob=(value)
      self.birthday = value
    end
    
    def without_email?
      self.email.blank?
    end
    
    def has_photo?
      !self.photo.blank?
    end
    
{'fraction_non_alphanumeric': 0.10290697674418604, 'fraction_numerical': 0.0011627906976744186, 'mean_word_length': 2.4767676767676767, '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': '6933646', 'n_tokens_mistral': 534, 'n_tokens_neox': 525, 'n_words': 124}