<commit_before>//
//  String.swift
//  Toolbelt
//
//  Created by <NAME> on 07/08/2015.
//  Copyright © 2015 <NAME>. All rights reserved.
//

import Contacts // iOS 9
import AddressBook // iOS 8

public func NSLocalizedStringFromName(givenName : String?, familyName : String?) -> String {
    if #available(iOS 9.0, *) {
        let contact = CNMutableContact()
        if let name = givenName {
            contact.givenName = name
        }
        if let name = familyName {
            contact.familyName = name
        }
        return CNContactFormatter.stringFromContact(contact, style: .FullName)!
    } else {
        let record = ABPersonCreate().takeRetainedValue()
        if let name = givenName {
            ABRecordSetValue(record, kABPersonFirstNameProperty, name, nil)
        }
        if let name = familyName {
            ABRecordSetValue(record, kABPersonLastNameProperty, name, nil)
        }
        return ABRecordCopyCompositeName(record).takeRetainedValue() as String
    }
}<commit_msg>Add annotation for min OSX version<commit_after>//
//  String.swift
//  Toolbelt
//
//  Created by <NAME> on 07/08/2015.
//  Copyright © 2015 <NAME>. All rights reserved.
//

import Contacts // iOS 9
import AddressBook // iOS 8

public func NSLocalizedStringFromName(givenName : String?, familyName : String?) -> String {
    if #available(iOS 9.0, OSX 10.11, *) {
        let contact = CNMutableContact()
        if let name = givenName {
            contact.givenName = name
        }
        if let name = familyName {
            contact.familyName = name
        }
        return CNContactFormatter.stringFromContact(contact, style: .FullName)!
    } else {
        let record = ABPersonCreate().takeRetainedValue()
        if let name = givenName {
            ABRecordSetValue(record, kABPersonFirstNameProperty, name, nil)
        }
        if let name = familyName {
            ABRecordSetValue(record, kABPersonLastNameProperty, name, nil)
        }
        return ABRecordCopyCompositeName(record).takeRetainedValue() as String
    }
}
{'fraction_non_alphanumeric': 0.0979631425800194, 'fraction_numerical': 0.01745877788554801, 'mean_word_length': 2.354471544715447, 'pattern_counts': {'":': 0, '<': 7, '<?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': '2340703', 'n_tokens_mistral': 621, 'n_tokens_neox': 571, 'n_words': 159}