<commit_before>//
//  SwiftyGlobal.swift
//  WHCWSIFT
//
//  Created by <NAME> on 9/28/17.
//  Copyright © 2017 <NAME>. All rights reserved.
//

import UIKit

public final class SwiftyGlobal
{
    private(set) static var screenSize : CGSize = UIScreen.main.bounds.size
    private(set) static var screenWidth : CGFloat = screenSize.width
    private(set) static var screenHeight : CGFloat = screenSize.height
    
    private(set) static var statusHeight : CGFloat = UIApplication.shared.statusBarFrame.size.height
    private(set) static var navHeight : CGFloat = UINavigationController().navigationBar.frame.size.height
    private(set) static var barHeight : CGFloat = statusHeight + navHeight
    
    private(set) static var keyWindow : UIWindow = UIApplication.shared.keyWindow!
    
    //internal static let modelName: String = {
    private(set) static var modelName: String = {
        var systemInfo = utsname()
        uname(&systemInfo)
        let machineMirror = Mirror(reflecting: systemInfo.machine)
        let identifier = machineMirror.children.reduce("") { identifier, element in
            guard let value = element.value as? Int8, value != 0 else { return identifier }
            return identifier + String(UnicodeScalar(UInt8(value)))
        }
        
        switch identifier {
        case "iPod5,1":                                 return "iPod Touch 5"
        case "iPod7,1":                                 return "iPod Touch 6"
        case "iPhone3,1", "iPhone3,2", "iPhone3,3":     return "iPhone 4"
        case "iPhone4,1":                               return "iPhone 4s"
        case "iPhone5,1", "iPhone5,2":                  return "iPhone 5"
        case "iPhone5,3", "iPhone5,4":                  return "iPhone 5c"
        case "iPhone6,1", "iPhone6,2":                  return "iPhone 5s"
        case "iPhone7,2":                               return "iPhone 6"
        case "iPhone7,1":                               return "iPhone 6 Plus"
        case "iPhone8,1":                               return "iPhone 6s"
        case "iPhone8,2":                               return "iPhone 6s Plus"
        case "iPhone9,1", "iPhone9,3":                  return "iPhone 7"
        case "iPhone9,2", "iPhone9,4":                  return "iPhone 7 Plus"
        case "iPhone8,4":                               return "iPhone SE"
        case "iPhone10,1", "iPhone10,4":                return "iPhone 8"
        case "iPhone10,2", "iPhone10,5":                return "iPhone 8 Plus"
        case "iPhone10,3", "iPhone10,6":                return "iPhone X"<commit_msg>update setting<commit_after>//
//  SwiftyGlobal.swift
//  WHCWSIFT
//
//  Created by <NAME> on 9/28/17.
//  Copyright © 2017 <NAME>. All rights reserved.
//

import UIKit

public final class SwiftyGlobal
{
    private(set) static var screenSize : CGSize = UIScreen.main.bounds.size
    private(set) static var screenWidth : CGFloat = screenSize.width
    private(set) static var screenHeight : CGFloat = screenSize.height
    
    private(set) static var statusHeight : CGFloat = UIApplication.shared.statusBarFrame.size.height
    private(set) static var navHeight : CGFloat = UINavigationController().navigationBar.frame.size.height
    private(set) static var barHeight : CGFloat = statusHeight + navHeight
    
    private(set) static var keyWindow : UIWindow = UIApplication.shared.keyWindow!
    
    //internal static let modelName: String = {
    private(set) static var modelName: String = {
        var systemInfo = utsname()
        uname(&systemInfo)
        let machineMirror = Mirror(reflecting: systemInfo.machine)
        let identifier = machineMirror.children.reduce("") { identifier, element in
            guard let value = element.value as? Int8, value != 0 else { return identifier }
            return identifier + String(UnicodeScalar(UInt8(value)))
        }
        
        switch identifier {
        case "iPod5,1":                                 return "iPod Touch 5"
        case "iPod7,1":                                 return "iPod Touch 6"
        case "iPhone3,1", "iPhone3,2", "iPhone3,3":     return "iPhone 4"
        case "iPhone4,1":                               return "iPhone 4s"
        case "iPhone5,1", "iPhone5,2":                  return "iPhone 5"
        case "iPhone5,3", "iPhone5,4":                  return "iPhone 5c"
        case "iPhone6,1", "iPhone6,2":                  return "iPhone 5s"
        case "iPhone7,2":                               return "iPhone 6"
        case "iPhone7,1":                               return "iPhone 6 Plus"
        case "iPhone8,1":                               return "iPhone 6s"
        case "iPhone8,2":                               return "iPhone 6s Plus"
        case "iPhone9,1", "iPhone9,3":                  return "iPhone 7"
        case "iPhone9,2", "iPhone9,4":                  return "iPhone 7 Plus"
        case "iPhone8,4":                               return "iPhone SE"
        case "iPhone10,1", "iPhone10,4":                return "iPhone 8"
        case "iPhone10,2", "iPhone10,5":                return "iPhone 8 Plus"
        case "iPhone10,3", "iPhone10,6":                return "iPhone X"
        case "iPhone11,2":                              return "iPhone XS"
        case "iPhone11,4", "iPhone11,6":                return "iPhone XS MAX"
        case "iPhone11,8":                              return "iPhone XR"
{'fraction_non_alphanumeric': 0.1012472487160675, 'fraction_numerical': 0.03411592076302274, 'mean_word_length': 1.7484879032258065, 'pattern_counts': {'":': 37, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4520590', 'n_tokens_mistral': 1639, 'n_tokens_neox': 1462, 'n_words': 427}