<commit_before>//
//  DateUtils.swift
//  TaskScheduler
//
//  Created by <NAME> on 10/12/15.
//  Copyright © 2015 <NAME>. All rights reserved.
//

import Foundation

class DateUtils {
    static func todayDay() -> NSDate {
        let calendar = NSCalendar.currentCalendar()
        return calendar.dateFromComponents(calendar.components([.Year, .Month, .Day], fromDate: NSDate()))!
    }
    
    static func tomorrowDay() -> NSDate {
        return DateUtils.dateByAddingDay(DateUtils.todayDay())
    }
    
    static func dateByAddingDay(date: NSDate) -> NSDate {
        return date.dateByAddingTimeInterval(24 * 60 * 60)
    }
    
    static func dateBySubtractingDay(date: NSDate) -> NSDate {
        return date.dateByAddingTimeInterval(-24 * 60 * 60)
    }
    
    static func removeTimeFromDate(date: NSDate) -> NSDate {
        return NSCalendar.currentCalendar().dateBySettingHour(0, minute: 0, second: 0, ofDate: date, options: NSCalendarOptions(rawValue: 0))!
    }
}<commit_msg>Cleaning up DateUtils<commit_after>//
//  DateUtils.swift
//  TaskScheduler
//
//  Created by <NAME> on 10/12/15.
//  Copyright © 2015 <NAME>. All rights reserved.
//

import Foundation

class DateUtils {
    // Returns an NSDate for today, without any time components
    static func todayDay() -> NSDate {
        return DateUtils.removeTimeFromDate(NSDate())
    }
    
    // Returns an NSDate for tomorrow, without any time components
    static func tomorrowDay() -> NSDate {
        return DateUtils.dateByAddingDay(DateUtils.todayDay())
    }
    
    // Returns an NSDate 24 hours in the future from the given date
    static func dateByAddingDay(date: NSDate) -> NSDate {
        return date.dateByAddingTimeInterval(24 * 60 * 60)
    }
    
    // Returns an NSDate 24 hours in the past from the given date
    static func dateBySubtractingDay(date: NSDate) -> NSDate {
        return date.dateByAddingTimeInterval(-24 * 60 * 60)
    }
    
    // Strips the given date of its time components
    static func removeTimeFromDate(date: NSDate) -> NSDate {
        return NSCalendar.currentCalendar().dateBySettingHour(0, minute: 0, second: 0, ofDate: date, options: NSCalendarOptions(rawValue: 0))!
    }
}
{'fraction_non_alphanumeric': 0.10628674807779286, 'fraction_numerical': 0.02532790592492085, 'mean_word_length': 2.8875219683655535, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 17, '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': '6485078', 'n_tokens_mistral': 720, 'n_tokens_neox': 681, 'n_words': 189}