<commit_before>class LocalTransactionEdition < WholeEdition
  include Expectant

  field :lgsl_code,         type: Integer
  field :introduction,      type: String
  field :more_information,  type: String
  @fields_to_clone = [:lgsl_code, :introduction, :more_information, :minutes_to_complete, :expectation_ids]

  validates_presence_of :lgsl_code
  validate              :valid_lgsl_code


  def valid_lgsl_code
    if ! self.service
      errors.add(:lgsl_code, "Invalid LGSL Code: '#{lgsl_code}'")
    end
  end

  def search_format
    "transaction"
  end

  def service
    LocalService.find_by_lgsl_code(lgsl_code)
  end

  def service_provided_by?(snac)
    authority = LocalAuthority.find_by_snac(snac)
    authority && authority.provides_service?(lgsl_code)
  end

  def whole_body
    self.introduction
  end
<commit_msg>duplicate validations<commit_after>class LocalTransactionEdition < WholeEdition
  include Expectant

  field :lgsl_code,         type: Integer
  field :introduction,      type: String
  field :more_information,  type: String
  @fields_to_clone = [:lgsl_code, :introduction, :more_information, :minutes_to_complete, :expectation_ids]

  validate              :valid_lgsl_code


  def valid_lgsl_code
    if ! self.service
      errors.add(:lgsl_code, "Invalid LGSL Code: '#{lgsl_code}'")
    end
  end

  def search_format
    "transaction"
  end

  def service
    LocalService.find_by_lgsl_code(lgsl_code)
  end

  def service_provided_by?(snac)
    authority = LocalAuthority.find_by_snac(snac)
    authority && authority.provides_service?(lgsl_code)
  end

  def whole_body
    self.introduction
  end

{'fraction_non_alphanumeric': 0.07513744654856444, 'fraction_numerical': 0.0, 'mean_word_length': 3.8176470588235296, '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': '4725279', 'n_tokens_mistral': 560, 'n_tokens_neox': 537, 'n_words': 113}