<commit_before>enum ObservableArrayChangeEvent<T> {
    case inserted(indices: [Int], elements: [T])
    case deleted(indices: [Int], elements: [T])
    case updated(indices: [Int], oldElements: [T], newElements: [T])
}

func ==<T: Equatable>(lhs: ObservableArrayChangeEvent<T>, rhs: ObservableArrayChangeEvent<T>) -> Bool {
    switch (lhs, rhs) {
    case (.inserted(let indicesLeft, let elementsLeft),
          .inserted(let indicesRight, let elementsRight)),
         (.deleted(let indicesLeft, let elementsLeft),
          .deleted(let indicesRight, let elementsRight)):
        return indicesLeft == indicesRight &&
            elementsLeft == elementsRight

    case (.updated(let indicesLeft, let oldElementsLeft, let newElementsLeft),
          .updated(let indicesRight, let oldElementsRight, let newElementsRight)):
        return indicesLeft == indicesRight &&
            oldElementsLeft == oldElementsRight &&
            newElementsLeft == newElementsRight

    default:
        return false
    }
}<commit_msg>Add equality function to array of ObservableArrayChangeEvent objects<commit_after>enum ObservableArrayChangeEvent<T> {
    case inserted(indices: [Int], elements: [T])
    case deleted(indices: [Int], elements: [T])
    case updated(indices: [Int], oldElements: [T], newElements: [T])
}

func ==<T: Equatable>(lhs: ObservableArrayChangeEvent<T>, rhs: ObservableArrayChangeEvent<T>) -> Bool {
    switch (lhs, rhs) {
    case (.inserted(let indicesLeft, let elementsLeft),
          .inserted(let indicesRight, let elementsRight)),
         (.deleted(let indicesLeft, let elementsLeft),
          .deleted(let indicesRight, let elementsRight)):
        return indicesLeft == indicesRight &&
            elementsLeft == elementsRight

    case (.updated(let indicesLeft, let oldElementsLeft, let newElementsLeft),
          .updated(let indicesRight, let oldElementsRight, let newElementsRight)):
        return indicesLeft == indicesRight &&
            oldElementsLeft == oldElementsRight &&
            newElementsLeft == newElementsRight

    default:
        return false
    }
}

func ==<T: Equatable>(lhs: [ObservableArrayChangeEvent<T>], rhs: [ObservableArrayChangeEvent<T>]) -> Bool {
    guard lhs.count == rhs.count else { return false }
    for index in lhs.startIndex..<lhs.endIndex {
        guard lhs[index] == rhs[index] else { return false }
    }
    return true
}
{'fraction_non_alphanumeric': 0.11425010386373079, 'fraction_numerical': 0.0, 'mean_word_length': 3.5093632958801497, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 17, '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': '8043', 'n_tokens_mistral': 651, 'n_tokens_neox': 640, 'n_words': 180}