<commit_before>//
//  KeychainWrapper.swift
//  KeychainWrapper
//
//  Created by <NAME> on 9/23/14.
//  Copyright (c) 2014 jasonrendel. All rights reserved.
//

import Foundation

class KeychainWrapper {
    private struct internalVars {
        static var serviceName: String = ""
    }
    
// MARK: Public Properties
    
    /*!
        @var serviceName
        @abstract Used for the kSecAttrService property to uniquely identify this keychain accessor.
        @discussion Service Name will default to the app's bundle identifier if it can
    */
    class var serviceName: String {
        get {
            if internalVars.serviceName.isEmpty {
                let bundleIdentifier = NSBundle.mainBundle().bundleIdentifier
                if let bundleIdentifierString = bundleIdentifier {
                    internalVars.serviceName = bundleIdentifierString
                } else {
                    internalVars.serviceName = "SwiftKeychainWrapper"
                }
            }
            return internalVars.serviceName
        }
        set(newServiceName) {
            internalVars.serviceName = newServiceName
        }
    }

// MARK: Public Methods
    class func hasValueForKey(key: String) -> Bool {
        var keychainData: NSData? = self.dataForKey(key)
        if let data = keychainData {
            return true
        } else {
            return false
        }
    }
   <commit_msg>updated some if let ... { } else { } syntax to be more compact and readable using the ?? operator.<commit_after>//
//  KeychainWrapper.swift
//  KeychainWrapper
//
//  Created by <NAME> on 9/23/14.
//  Copyright (c) 2014 jasonrendel. All rights reserved.
//

import Foundation

class KeychainWrapper {
    private struct internalVars {
        static var serviceName: String = ""
    }
    
// MARK: Public Properties
    
    /*!
        @var serviceName
        @abstract Used for the kSecAttrService property to uniquely identify this keychain accessor.
        @discussion Service Name will default to the app's bundle identifier if it can
    */
    class var serviceName: String {
        get {
            if internalVars.serviceName.isEmpty {
                internalVars.serviceName = NSBundle.mainBundle().bundleIdentifier ?? "SwiftKeychainWrapper"
            }
            return internalVars.serviceName
        }
        set(newServiceName) {
            internalVars.serviceName = newServiceName
        }
    }

// MARK: Public Methods
    class func hasValueForKey(key: String) -> Bool {
        var keychainData: NSData? = self.dataForKey(key)
        if let data = keychainData {
            return true
        } else {
            return false
        }
    }
   
{'fraction_non_alphanumeric': 0.07547169811320754, 'fraction_numerical': 0.006659267480577136, 'mean_word_length': 1.9169363538295576, 'pattern_counts': {'":': 0, '<': 5, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4995244', 'n_tokens_mistral': 716, 'n_tokens_neox': 686, 'n_words': 207}