<commit_before>//
//  User.swift
//  PartyUP
//
//  Created by <NAME> on 2016-06-30.
//  Copyright © 2016 Sandcastle Application Development. All rights reserved.
//

import Foundation
import FBSDKCoreKit

class User {
	var aliases = [NSLocalizedString("Anonymous Milquetoast", comment: "anonymous user moniker")]

	init() {
		refresh()

		NSNotificationCenter.defaultCenter().addObserverForName(FBSDKAccessTokenDidChangeNotification, object: nil, queue: NSOperationQueue.mainQueue()) { _ in self.refresh() }
	}

	func refresh() {
		if let token = FBSDKAccessToken.currentAccessToken() where token.hasGranted("public_profile") {
			FBSDKGraphRequest.init(graphPath: "me", parameters: ["fields":"name"]).startWithCompletionHandler({ (connection, profile, error) in
				if error == nil {
                    if let name = profile["name"] as? String {
                        self.aliases.append(name)
                    }
				}
			})
		}<commit_msg>Remove an unnecessary explicit call to init.<commit_after>//
//  User.swift
//  PartyUP
//
//  Created by <NAME> on 2016-06-30.
//  Copyright © 2016 Sandcastle Application Development. All rights reserved.
//

import Foundation
import FBSDKCoreKit

class User {
	var aliases = [NSLocalizedString("Anonymous Milquetoast", comment: "anonymous user moniker")]

	init() {
		refresh()

		NSNotificationCenter.defaultCenter().addObserverForName(FBSDKAccessTokenDidChangeNotification, object: nil, queue: NSOperationQueue.mainQueue()) { _ in self.refresh() }
	}

	func refresh() {
		if let token = FBSDKAccessToken.currentAccessToken() where token.hasGranted("public_profile") {
			FBSDKGraphRequest(graphPath: "me", parameters: ["fields":"name"]).startWithCompletionHandler({ (connection, profile, error) in
				if error == nil {
                    if let name = profile["name"] as? String {
                        self.aliases.append(name)
                    }
				}
			})
		}
{'fraction_non_alphanumeric': 0.12070759625390219, 'fraction_numerical': 0.012486992715920915, 'mean_word_length': 3.340857787810384, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1501779', 'n_tokens_mistral': 611, 'n_tokens_neox': 531, 'n_words': 138}