<commit_before>import Foundation

private func escape(string: String) -> String {
    //Reserved characters defined by RFC 3986
    let genDelims = ":/?#[]@"
    let subDelims = "!$&'()*+,;="
    let reservedCharacters = genDelims + subDelims
    let allowedCharacterSet = NSCharacterSet.URLQueryAllowedCharacterSet().mutableCopy() as! NSMutableCharacterSet
    allowedCharacterSet.removeCharactersInString(reservedCharacters)
    return string.stringByAddingPercentEncodingWithAllowedCharacters(allowedCharacterSet) ?? string
}

private func unescape(string: String) -> String {
    return CFURLCreateStringByReplacingPercentEscapes(nil, string, nil) as String
}<commit_msg>Fix coding style<commit_after>import Foundation

private func escape(string: String) -> String {
    // Reserved characters defined by RFC 3986
    // Reference: https://www.ietf.org/rfc/rfc3986.txt
    let generalDelimiters = ":/?#[]@"
    let subDelimiters = "!$&'()*+,;="
    let reservedCharacters = generalDelimiters + subDelimiters
    
    let allowedCharacterSet = NSMutableCharacterSet()
    allowedCharacterSet.formUnionWithCharacterSet(NSCharacterSet.URLQueryAllowedCharacterSet())
    allowedCharacterSet.removeCharactersInString(reservedCharacters)
    
    return string.stringByAddingPercentEncodingWithAllowedCharacters(allowedCharacterSet) ?? string
}

private func unescape(string: String) -> String {
    return CFURLCreateStringByReplacingPercentEscapes(nil, string, nil) as String
}
{'fraction_non_alphanumeric': 0.09607577807848444, 'fraction_numerical': 0.008119079837618403, 'mean_word_length': 5.515418502202643, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, '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': '3381089', 'n_tokens_mistral': 429, 'n_tokens_neox': 408, 'n_words': 85}