<commit_before>//
//  _____ _           _____
// |   __| |_ ___ ___|   __|_ _ ___
// |__   |   | . | . |  |  | | |   |
// |_____|_|_|___|  _|_____|___|_|_|
//               |_|
//
//  Copyright (c) 2016 ShopGun. All rights reserved.

import Foundation
import Valet

struct Utils {

    static func fetchInfoPlistValue(key:String) -> AnyObject? {
        if let configDict = Bundle.main.object(forInfoDictionaryKey: "ShopGunSDK") as? [String:AnyObject] {
            return configDict[key]
        }
        return nil
    }
    
    static let ISO8601_dateFormatter:DateFormatter = {
        let formatter = DateFormatter()
        formatter.locale = Locale(identifier: "en_US_POSIX")
        formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZZZZZ"
        return formatter
    }()
    
    
    fileprivate static let keychainValet:VALValet? = VALValet(identifier: "com.shopgun.ios.sdk.keychain", accessibility: .afterFirstUnlock)
    static func setKeychainString(_ string:String, key:String) -> Bool {
        return keychainValet?.setString(string, forKey: key) ?? false
    }
    static func getKeychainString(_ key:String) -> String? {<commit_msg>Fix mistake in swift-3-ification<commit_after>//
//  _____ _           _____
// |   __| |_ ___ ___|   __|_ _ ___
// |__   |   | . | . |  |  | | |   |
// |_____|_|_|___|  _|_____|___|_|_|
//               |_|
//
//  Copyright (c) 2016 ShopGun. All rights reserved.

import Foundation
import Valet

struct Utils {

    static func fetchInfoPlistValue(_ key:String) -> AnyObject? {
        if let configDict = Bundle.main.object(forInfoDictionaryKey: "ShopGunSDK") as? [String:AnyObject] {
            return configDict[key]
        }
        return nil
    }
    
    static let ISO8601_dateFormatter:DateFormatter = {
        let formatter = DateFormatter()
        formatter.locale = Locale(identifier: "en_US_POSIX")
        formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZZZZZ"
        return formatter
    }()
    
    
    fileprivate static let keychainValet:VALValet? = VALValet(identifier: "com.shopgun.ios.sdk.keychain", accessibility: .afterFirstUnlock)
    static func setKeychainString(_ string:String, key:String) -> Bool {
        return keychainValet?.setString(string, forKey: key) ?? false
    }
    static func getKeychainString(_ key:String) -> String? {
{'fraction_non_alphanumeric': 0.12332902112979732, 'fraction_numerical': 0.007330746011211729, 'mean_word_length': 2.6080870917573873, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '5414345', 'n_tokens_mistral': 782, 'n_tokens_neox': 735, 'n_words': 136}