<commit_before>import Foundation

extension Dictionary where Key == String {
    var urlEncoded: String {
        let params = self
            .mapValues { String(describing: $0) }
            .map { (key: String, value: String) in (key: key.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!, value: value.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!) }

        // TODO: Uniqueing Dictionary init doesn't want to work at this point :/
        var dict = Dictionary<String, String>()
        for (key, value) in params {
            dict[key] = value
        }

        return dict
            .map { (key: String, value: String) in return "\(key)=\(value)" }
            .joined(separator: "&")
    }

    var asJSON: Data? {
        return try? JSONSerialization.data(withJSONObject: self)
    }
}
<commit_msg>remove old unused code<commit_after>import Foundation

extension Dictionary where Key == String {
    var asJSON: Data? {
        return try? JSONSerialization.data(withJSONObject: self)
    }
}

{'fraction_non_alphanumeric': 0.10758885686839577, 'fraction_numerical': 0.0009606147934678194, 'mean_word_length': 2.7214285714285715, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '5443702', 'n_tokens_mistral': 291, 'n_tokens_neox': 288, 'n_words': 85}