<commit_before>package hmda.validation.rules.lar.validity

import hmda.model.census.CBSATractLookup
import hmda.model.fi.lar.LoanApplicationRegister
import hmda.validation.dsl.Result
import hmda.validation.rules.EditCheck


object V285 extends EditCheck[LoanApplicationRegister]  {

  val cbsaTracts = CBSATractLookup.values

  override def name: String = "V285"

  override def apply(input: LoanApplicationRegister): Result = {
    val state = input.geography.state
    val stateCodes = cbsaTracts.map(c => c.state)
    val msa = input.geography.msa

    val validState = state is containedIn(stateCodes)

    val NA = when(state is equalTo("NA")) {
      msa is equalTo("NA")
    }

    val checkState = when(state not equalTo("NA")) {
      validState
    }<commit_msg>Resolve merge conflicts<commit_after>package hmda.validation.rules.lar.validity

import hmda.model.census.CBSATractLookup
import hmda.model.fi.lar.LoanApplicationRegister
import hmda.validation.dsl.Result
import hmda.validation.rules.EditCheck

object V285 extends EditCheck[LoanApplicationRegister] {

  val cbsaTracts = CBSATractLookup.values

  override def name: String = "V285"

  override def apply(input: LoanApplicationRegister): Result = {
    val state = input.geography.state
    val stateCodes = cbsaTracts.map(c => c.state)
    val msa = input.geography.msa

    val validState = state is containedIn(stateCodes)

    val NA = when(state is equalTo("NA")) {
      msa is equalTo("NA")
    }

    val checkState = when(state not equalTo("NA")) {
      validState
    }
{'fraction_non_alphanumeric': 0.09407216494845361, 'fraction_numerical': 0.007731958762886598, 'mean_word_length': 3.9935691318327975, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1220608', 'n_tokens_mistral': 519, 'n_tokens_neox': 497, 'n_words': 114}