<commit_before>import Foundation

/// Dictionary-like structure that manages a set of arrays for each key
public struct ArrayDictionary<Key: Hashable, ArrayValue> {
    /// The key contained within this structure
    public var keys: [Key] { return self.dictionary.keys.array }
    
    private var dictionary: [Key : [ArrayValue]]
    
    /// Create a new instance of this structure
    public init() {
        self.dictionary = [:]
    }
    
    /// Subscript support
    public subscript(key: Key) -> [ArrayValue]? {
        get {
            return self.dictionary[key]
        }
        set {
            self.dictionary[key] = newValue
        }
    }
    
    /// Insert a value into this stucture. If an existing array exists, it will be appended.
    public mutating func insertValue(value: ArrayValue, intoArrayForKey key: Key) {
        if var arrayForKey = self[key] {
            arrayForKey.append(value)
            self.dictionary[key] = arrayForKey
        } else {
            self.dictionary[key] = [value]
        }
    }
}<commit_msg>ArrayDictionary: Update to latest Array API<commit_after>import Foundation

/// Dictionary-like structure that manages a set of arrays for each key
public struct ArrayDictionary<Key: Hashable, ArrayValue> {
    /// The key contained within this structure
    public var keys: [Key] { return Array(self.dictionary.keys) }
    
    private var dictionary: [Key : [ArrayValue]]
    
    /// Create a new instance of this structure
    public init() {
        self.dictionary = [:]
    }
    
    /// Subscript support
    public subscript(key: Key) -> [ArrayValue]? {
        get {
            return self.dictionary[key]
        }
        set {
            self.dictionary[key] = newValue
        }
    }
    
    /// Insert a value into this stucture. If an existing array exists, it will be appended.
    public mutating func insertValue(value: ArrayValue, intoArrayForKey key: Key) {
        if var arrayForKey = self[key] {
            arrayForKey.append(value)
            self.dictionary[key] = arrayForKey
        } else {
            self.dictionary[key] = [value]
        }
    }
}
{'fraction_non_alphanumeric': 0.09324009324009325, 'fraction_numerical': 0.0, 'mean_word_length': 2.12372634643377, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '5367505', 'n_tokens_mistral': 591, 'n_tokens_neox': 573, 'n_words': 185}