<commit_before>//
//  Copyright (c) 2014-2016 Actor LLC. <https://actor.im>
//

import Foundation

public struct AACellSetting: Equatable {
    let showDate: Bool
    let clenchTop: Bool
    let clenchBottom: Bool
    
    init(showDate: Bool, clenchTop: Bool, clenchBottom: Bool) {
        self.showDate = showDate
        self.clenchTop = clenchTop
        self.clenchBottom = clenchBottom
    }
    
}

public func ==(lhs: AACellSetting, rhs: AACellSetting) -> Bool {
    return lhs.showDate == rhs.showDate && lhs.clenchTop == rhs.clenchTop && lhs.clenchBottom == rhs.clenchBottom
}

private let dateFormatter = NSDateFormatter().initDateFormatter()

public class AACellLayout {
    
    let layouter: AABubbleLayouter
    let key: String
    var height: CGFloat
    let date: String
    
    public init(height: CGFloat, date: Int64, key: String, layouter: AABubbleLayouter) {
        self.date = AACellLayout.formatDate(date)
        self.key = key
        self.height = height
        self.layouter = layouter
    }
    
    public class func formatDate(date: Int64) -> String {
        return dateFormatter.stringFromDate(NSDate(timeIntervalSince1970: NSTimeInterval(Double(date) / 1000.0)))
    }
}

extension NSDateFormatter {
    func initDateFormatter() -> NSDateFormatter {
        dateFormat = "HH:mm"
        return self
    }
}<commit_msg>fix anchor date<commit_after>//
//  Copyright (c) 2014-2016 Actor LLC. <https://actor.im>
//

import Foundation

public struct AACellSetting: Equatable {
    let showDate: Bool
    let clenchTop: Bool
    let clenchBottom: Bool
    
    init(showDate: Bool, clenchTop: Bool, clenchBottom: Bool) {
        self.showDate = showDate
        self.clenchTop = clenchTop
        self.clenchBottom = clenchBottom
    }
    
}

public func ==(lhs: AACellSetting, rhs: AACellSetting) -> Bool {
    return lhs.showDate == rhs.showDate && lhs.clenchTop == rhs.clenchTop && lhs.clenchBottom == rhs.clenchBottom
}

private let dateFormatter = NSDateFormatter().initDateFormatter()

public class AACellLayout {
    
    let layouter: AABubbleLayouter
    let key: String
    var height: CGFloat
    let date: String
    let anchorDate: String
    
    public init(height: CGFloat, date: Int64, key: String, layouter: AABubbleLayouter) {
        self.date = AACellLayout.formatDate(date)
        self.anchorDate = Actor.getFormatter().formatDate(date)
        self.key = key
        self.height = height
        self.layouter = layouter
    }
    
    public class func formatDate(date: Int64) -> String {
        return dateFormatter.stringFromDate(NSDate(timeIntervalSince1970: NSTimeInterval(Double(date) / 1000.0)))
        
        
    }
}

extension NSDateFormatter {
    func initDateFormatter() -> NSDateFormatter {
        dateFormat = "HH:mm"
        return self
    }
}

{'fraction_non_alphanumeric': 0.09673990077958894, 'fraction_numerical': 0.014883061658398299, 'mean_word_length': 2.840816326530612, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '3234164', 'n_tokens_mistral': 951, 'n_tokens_neox': 884, 'n_words': 213}