<commit_before>//
//  Date+Formatting.swift
//  Swiftlier
//
//  Created by <NAME> on 10/9/15.
//  Copyright © 2015 Drewag LLC. All rights reserved.
//

import Foundation

private let dateAndTimeFormatter: DateFormatter = {
    var dateFormatter = DateFormatter()
    dateFormatter.locale = Locale(identifier:"en_US_POSIX")
    dateFormatter.dateFormat = "yyyy'-'MM'-'dd' at 'hh:mm a"
    return dateFormatter
}()

private let timeFormatter: DateFormatter = {
    var dateFormatter = DateFormatter()
    dateFormatter.timeStyle = .short
    return dateFormatter
}()

private let dateFormatter: DateFormatter = {
    var dateFormatter = DateFormatter()
    dateFormatter.locale = Locale(identifier:"en_US_POSIX")
    dateFormatter.dateFormat = "MMM. dd, yyyy"
    return dateFormatter
}()

private let shortDateFormatter: DateFormatter = {
    var dateFormatter = DateFormatter()
    dateFormatter.setLocalizedDateFormatFromTemplate("MMddyyyy")
    return dateFormatter
}()

private let shortestDateFormatter: DateFormatter = {
    var dateFormatter = DateFormatter()
    dateFormatter.dateStyle = .short
    return dateFormatter
}()

private let dayAndMonthFormatter: DateFormatter = {
    var dateFormatter = DateFormatter()
    dateFormatter.setLocalizedDateFormatFromTemplate("MMdd")
    return dateFormatter
}()

private let monthAndYearFormatter: DateFormatter = {
    var dateFormatter = DateFormatter()
    dateFormatter.setLocalizedDateFormatFromTemplate("MMyyyy")
    return dateFormatter
}()

private let longMonthAndYearFormatter: DateFormatter = {
    var dateFormatter = DateFormatter()
    dateFormatter.setLocalizedDateFormatFromTemplate("MMMMyyyy")
    return dateFormatter
}()

private let monthFormatter: DateFormatter = {
    var dateFormatter = DateFormatter()
    dateFormatter.locale = Locale(identifier:"en_US_POSIX")
    dateFormatter.dateFormat = "MMMM"
    return dateFormatter
}()

private let yearFormatter: DateFormatter = {
    var dateFormatter = DateFormatter()
    dateFormatter.locale = Locale(identifier:"en_US_POSIX")
    dateFormatter.dateFormat = "yyyy"
    return dateFormatter
}()

private let gmtDateTimeFormatter: DateFormatter = {
    let dateFormatter = DateFormatter()
    dateFormatter.locale = Locale(identifier:"en_US_POSIX")
    dateFormatter.timeZone = TimeZone(identifier: "GMT")
    dateFormatter.dateFormat = "E, d MMM yyyy HH:mm:ss 'GMT'"
    return dateFormatter
}()

private let railsDateTimeFormatter: DateFormatter = {
    var dateFormatter = DateFormatter()
    let timeZone = TimeZone(identifier: "UTC")
    dateFormatter.dateFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'"
    dateFormatter.timeZone = timeZone
    return dateFormatter
}()

public let ISO8601DateTimeFormatters: [DateFormatter] = {
    var dateFormatter1 = DateFormatter()
    let timeZone = TimeZone(identifier: "UTC")
    dateFormatter1.dateFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'S'Z'"
    dateFormatter1.timeZone = timeZone

    var dateFormatter2 = DateFormatter()
    dateFormatter2.dateFormat = "yyyy'-'MM'-'dd' 'HH':'mm':'ss'.'S'Z'"
    dateFormatter2.timeZone = timeZone

    var dateFormatter3 = DateFormatter()
    dateFormatter3.dateFormat = "yyyy'-'MM'-'dd' 'HH':'mm':'ss'.'SSSSSS'Z'"
    dateFormatter3.timeZone = timeZone

    var dateFormatter4 = DateFormatter()
    dateFormatter4.dateFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'SSSSSS'Z'"
    dateFormatter4.timeZone = timeZone

    var dateFormatter5 = DateFormatter()
    dateFormatter5.dateFormat = "yyyy'-'MM'-'dd' 'HH':'mm':'ss'Z'"
    dateFormatter5.timeZone = timeZone

    return [dateFormatter1, dateFormatter2, dateFormatter3, dateFormatter4, dateFormatter5]
}()

private let localIso8601DateTimeFormatter: DateFormatter = {
    var dateFormatter = DateFormatter()
    dateFormatter.dateFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'S"
    return dateFormatter
}()

private let railsDateFormatter: DateFormatter = {
    var dateFormatter = DateFormatter()
    dateFormatter.dateFormat = "yyyy'-'MM'-'dd"
    return dateFormatter
}()

private let authTokenDate: DateFormatter = {
    var dateFormatter = DateFormatter()
    dateFormatter.dateFormat = "ddMMyyyy"
    return dateFormatter
}()

private let preciseTimeFormatter: DateFormatter = {
    var dateFormatter = DateFormatter()
    let timeZone = TimeZone(identifier: "UTC")
    dateFormatter.dateFormat = "HH':'mm':'ss"
    dateFormatter.timeZone = timeZone
    return dateFormatter
}()
<commit_msg>[BF] Fix iso8601 date formatting in Indonesia<commit_after>//
//  Date+Formatting.swift
//  Swiftlier
//
//  Created by <NAME> on 10/9/15.
//  Copyright © 2015 Drewag LLC. All rights reserved.
//

import Foundation

private let dateAndTimeFormatter: DateFormatter = {
    var dateFormatter = DateFormatter()
    dateFormatter.locale = Locale(identifier:"en_US_POSIX")
    dateFormatter.dateFormat = "yyyy'-'MM'-'dd' at 'hh:mm a"
    return dateFormatter
}()

private let timeFormatter: DateFormatter = {
    var dateFormatter = DateFormatter()
    dateFormatter.timeStyle = .short
    return dateFormatter
}()

private let dateFormatter: DateFormatter = {
    var dateFormatter = DateFormatter()
    dateFormatter.locale = Locale(identifier:"en_US_POSIX")
    dateFormatter.dateFormat = "MMM. dd, yyyy"
    return dateFormatter
}()

private let shortDateFormatter: DateFormatter = {
    var dateFormatter = DateFormatter()
    dateFormatter.setLocalizedDateFormatFromTemplate("MMddyyyy")
    return dateFormatter
}()

private let shortestDateFormatter: DateFormatter = {
    var dateFormatter = DateFormatter()
    dateFormatter.dateStyle = .short
    return dateFormatter
}()

private let dayAndMonthFormatter: DateFormatter = {
    var dateFormatter = DateFormatter()
    dateFormatter.setLocalizedDateFormatFromTemplate("MMdd")
    return dateFormatter
}()

private let monthAndYearFormatter: DateFormatter = {
    var dateFormatter = DateFormatter()
    dateFormatter.setLocalizedDateFormatFromTemplate("MMyyyy")
    return dateFormatter
}()

private let longMonthAndYearFormatter: DateFormatter = {
    var dateFormatter = DateFormatter()
    dateFormatter.setLocalizedDateFormatFromTemplate("MMMMyyyy")
    return dateFormatter
}()

private let monthFormatter: DateFormatter = {
    var dateFormatter = DateFormatter()
    dateFormatter.locale = Locale(identifier:"en_US_POSIX")
    dateFormatter.dateFormat = "MMMM"
    return dateFormatter
}()

private let yearFormatter: DateFormatter = {
    var dateFormatter = DateFormatter()
    dateFormatter.locale = Locale(identifier:"en_US_POSIX")
    dateFormatter.dateFormat = "yyyy"
    return dateFormatter
}()

private let gmtDateTimeFormatter: DateFormatter = {
    let dateFormatter = DateFormatter()
    dateFormatter.locale = Locale(identifier:"en_US_POSIX")
    dateFormatter.timeZone = TimeZone(identifier: "GMT")
    dateFormatter.dateFormat = "E, d MMM yyyy HH:mm:ss 'GMT'"
    return dateFormatter
}()

private let railsDateTimeFormatter: DateFormatter = {
    var dateFormatter = DateFormatter()
    let timeZone = TimeZone(identifier: "UTC")
    dateFormatter.dateFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'"
    dateFormatter.locale = Locale(identifier: "en_US")
    dateFormatter.timeZone = timeZone
    return dateFormatter
}()

public let ISO8601DateTimeFormatters: [DateFormatter] = {
    var dateFormatter1 = DateFormatter()
    let timeZone = TimeZone(identifier: "UTC")
    dateFormatter1.dateFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'S'Z'"
    dateFormatter1.locale = Locale(identifier: "en_US")
    dateFormatter1.timeZone = timeZone

    var dateFormatter2 = DateFormatter()
    dateFormatter2.dateFormat = "yyyy'-'MM'-'dd' 'HH':'mm':'ss'.'S'Z'"
    dateFormatter2.locale = Locale(identifier: "en_US")
    dateFormatter2.timeZone = timeZone

    var dateFormatter3 = DateFormatter()
    dateFormatter3.dateFormat = "yyyy'-'MM'-'dd' 'HH':'mm':'ss'.'SSSSSS'Z'"
    dateFormatter3.locale = Locale(identifier: "en_US")
    dateFormatter3.timeZone = timeZone

    var dateFormatter4 = DateFormatter()
    dateFormatter4.dateFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'SSSSSS'Z'"
    dateFormatter4.locale = Locale(identifier: "en_US")
    dateFormatter4.timeZone = timeZone

    var dateFormatter5 = DateFormatter()
    dateFormatter5.dateFormat = "yyyy'-'MM'-'dd' 'HH':'mm':'ss'Z'"
    dateFormatter5.locale = Locale(identifier: "en_US")
    dateFormatter5.timeZone = timeZone

    return [dateFormatter1, dateFormatter2, dateFormatter3, dateFormatter4, dateFormatter5]
}()

private let localIso8601DateTimeFormatter: DateFormatter = {
    var dateFormatter = DateFormatter()
    dateFormatter.dateFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'S"
    dateFormatter.locale = Locale(identifier: "en_US")
    return dateFormatter
}()

private let railsDateFormatter: DateFormatter = {
    var dateFormatter = DateFormatter()
    dateFormatter.dateFormat = "yyyy'-'MM'-'dd"
    return dateFormatter
}()

private let authTokenDate: DateFormatter = {
    var dateFormatter = DateFormatter()
    dateFormatter.dateFormat = "ddMMyyyy"
    return dateFormatter
}()

private let preciseTimeFormatter: DateFormatter = {
    var dateFormatter = DateFormatter()
    let timeZone = TimeZone(identifier: "UTC")
    dateFormatter.dateFormat = "HH':'mm':'ss"
    dateFormatter.timeZone = timeZone
    return dateFormatter
}()

{'fraction_non_alphanumeric': 0.11545883361921097, 'fraction_numerical': 0.00889794168096055, 'mean_word_length': 4.619879518072289, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5210826', 'n_tokens_mistral': 2859, 'n_tokens_neox': 2713, 'n_words': 581}