<commit_before>//
//  DateFormatter.swift
//  Date
//
//  Created by <NAME> on 3/16/16.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import Foundation
import CoreFoundation

public final class Locale {
    public let locale: CFLocale
    public init?(identifier: String) {
        let locale = CFLocaleCreate(nil, CFString.from(identifier))
        if locale == nil {
            return nil
        }
        self.locale = locale
    }
}

#if os(OSX)
#else
    // https://github.com/apple/swift-corelibs-foundation/blob/master/CoreFoundation/Locale.subproj/CFDateFormatter.h#L36
    public enum CFDateFormatterStyle : Int {
        
        case noStyle = 0
        case shortStyle = 1
        case mediumStyle = 2
        case longStyle = 3
        case fullStyle = 4
    }
#endif


public final class DateFormatter {
    public let formatter: CFDateFormatter
    public init(locale: Locale, dateStyle: CFDateFormatterStyle = .noStyle, timeStyle: CFDateFormatterStyle = .noStyle) {
        #if os(OSX)
            formatter = CFDateFormatterCreate(nil, locale.locale, dateStyle, timeStyle)
        #else
        formatter = CFDateFormatterCreate(nil, locale.locale, dateStyle.rawValue, timeStyle.rawValue)
        #endif
        timeZone = NSTimeZone.defaultTimeZone()
    }
    public var dateFormat: String? {
        didSet {
            if let val = dateFormat {
                CFDateFormatterSetFormat(formatter, CFString.from(val))
            }
        }
    }
    public var timeZone: NSTimeZone {
        didSet {
            CFDateFormatterSetProperty(formatter, kCFDateFormatterTimeZone, timeZone)
        }
    }
}

public extension DateFormatter {
    
    func string(from date: Date) -> String {
        return CFDateFormatterCreateStringWithAbsoluteTime(nil, formatter, date.absoluteTime).swiftString
    }
    <commit_msg>fix for 2016-05-03 Snapshot<commit_after>//
//  DateFormatter.swift
//  Date
//
//  Created by <NAME> on 3/16/16.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import Foundation
import CoreFoundation

public final class Locale {
    public let locale: CFLocale
    public init?(identifier: String) {
        let locale = CFLocaleCreate(nil, CFString.from(identifier))
        if locale == nil {
            return nil
        }
        self.locale = locale
    }
}

#if os(OSX)
#else
    // https://github.com/apple/swift-corelibs-foundation/blob/master/CoreFoundation/Locale.subproj/CFDateFormatter.h#L36
    public enum CFDateFormatterStyle : Int {
        
        case noStyle = 0
        case shortStyle = 1
        case mediumStyle = 2
        case longStyle = 3
        case fullStyle = 4
    }
#endif


public final class DateFormatter {
    public let formatter: CFDateFormatter
    public init(locale: Locale, dateStyle: CFDateFormatterStyle = .noStyle, timeStyle: CFDateFormatterStyle = .noStyle) {
        #if os(OSX)
            formatter = CFDateFormatterCreate(nil, locale.locale, dateStyle, timeStyle)
        #else
        formatter = CFDateFormatterCreate(nil, locale.locale, dateStyle.rawValue, timeStyle.rawValue)
        #endif
        timeZone = NSTimeZone.default()
    }
    public var dateFormat: String? {
        didSet {
            if let val = dateFormat {
                CFDateFormatterSetFormat(formatter, CFString.from(val))
            }
        }
    }
    public var timeZone: NSTimeZone {
        didSet {
            CFDateFormatterSetProperty(formatter, kCFDateFormatterTimeZone, timeZone)
        }
    }
}

public extension DateFormatter {
    
    func string(from date: Date) -> String {
        return CFDateFormatterCreateStringWithAbsoluteTime(nil, formatter, date.absoluteTime).swiftString
    }
    
{'fraction_non_alphanumeric': 0.0868861305990286, 'fraction_numerical': 0.010793308148947653, 'mean_word_length': 2.4009174311926604, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 2, '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': '5419508', 'n_tokens_mistral': 1093, 'n_tokens_neox': 1048, 'n_words': 261}