<commit_before>import Foundation

public class Edit: Equatable {
    public let clientId: String
    public let documentId: String
    public let clientVersion: Int
    public let serverVersion: Int
    public let checksum: String
    public let diffs: Array<Edit.Diff>

    public init(clientId: String, documentId: String, clientVersion: Int, serverVersion: Int, checksum: String, diffs: Array<Edit.Diff>) {
        self.clientId = clientId
        self.documentId = documentId
        self.clientVersion = clientVersion
        self.serverVersion = serverVersion
        self.checksum = checksum
        self.diffs = diffs
    }
    
    public enum Operation {
        case Add, Delete, Unchanged
    }
    
    public class Diff {
    
        public let operation: Operation
        public let text: String
    
        public init(operation: Operation, text: String) {
            self.operation = operation
            self.text = text
        }
    }

}

public func ==(lhs: Edit, rhs: Edit) -> Bool {
    return lhs.clientId == rhs.clientId &&
        lhs.documentId == rhs.documentId &&
        lhs.serverVersion == rhs.serverVersion &&
        lhs.checksum == rhs.checksum &&
        lhs.diffs.count == rhs.diffs.count
}

<commit_msg>Adding name() function to Edit.Operation enum.<commit_after>import Foundation

public class Edit: Equatable {
    public let clientId: String
    public let documentId: String
    public let clientVersion: Int
    public let serverVersion: Int
    public let checksum: String
    public let diffs: Array<Edit.Diff>

    public init(clientId: String, documentId: String, clientVersion: Int, serverVersion: Int, checksum: String, diffs: Array<Edit.Diff>) {
        self.clientId = clientId
        self.documentId = documentId
        self.clientVersion = clientVersion
        self.serverVersion = serverVersion
        self.checksum = checksum
        self.diffs = diffs
    }

    public enum Operation {
        case Add, Delete, Unchanged

        func name() -> String {
            switch self {
            case .Add:
                return "Add"
            case .Delete:
                return "Delete"
            case .Unchanged:
                return "Unchanged"
            }
        }
    }
    
    public class Diff {
    
        public let operation: Operation
        public let text: String
    
        public init(operation: Operation, text: String) {
            self.operation = operation
            self.text = text
        }
    }

}

public func ==(lhs: Edit, rhs: Edit) -> Bool {
    return lhs.clientId == rhs.clientId &&
        lhs.documentId == rhs.documentId &&
        lhs.serverVersion == rhs.serverVersion &&
        lhs.checksum == rhs.checksum &&
        lhs.diffs.count == rhs.diffs.count
}


{'fraction_non_alphanumeric': 0.08423326133909287, 'fraction_numerical': 0.0, 'mean_word_length': 2.0775193798449614, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 10, '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': '2189929', 'n_tokens_mistral': 760, 'n_tokens_neox': 748, 'n_words': 222}