<commit_before>//
//  AppDelegate.swift
//  Freetime
//
//  Created by <NAME> on 4/30/17.
//  Copyright © 2017 <NAME>. All rights reserved.
//

import UIKit
import Alamofire

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?
    private var showingLogin = false
    private let flexController = FlexController()
    private let sessionManager = GithubSessionManager()

    private lazy var rootNavigationManager: RootNavigationManager = {
        return RootNavigationManager(
            sessionManager: self.sessionManager,
            rootViewController: self.window?.rootViewController as! UISplitViewController
        )
    }()

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        // initialize a webview at the start so webview startup later on isn't so slow
        let _ = UIWebView()
        flexController.configureWindow(window)
        window?.backgroundColor = Styles.Colors.background
        rootNavigationManager.resetRootViewController(userSession: sessionManager.userSession)
        return true
    }

    func applicationDidBecomeActive(_ application: UIApplication) {
        if showingLogin == false && sessionManager.userSession == nil {
            showingLogin = true
            rootNavigationManager.showLogin(animated: false)
        }
    }

    func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
        if let sourceApp = options[.sourceApplication],
            String(describing: sourceApp) == "com.apple.SafariViewService" {
            sessionManager.receivedCodeRedirect(url: url)
            return true
        }
        return false
    }
    
}
<commit_msg>Activate NetworkActivityIndicatorManager<commit_after>//
//  AppDelegate.swift
//  Freetime
//
//  Created by <NAME> on 4/30/17.
//  Copyright © 2017 <NAME>. All rights reserved.
//

import UIKit
import Alamofire
import AlamofireNetworkActivityIndicator

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?
    private var showingLogin = false
    private let flexController = FlexController()
    private let sessionManager = GithubSessionManager()

    private lazy var rootNavigationManager: RootNavigationManager = {
        return RootNavigationManager(
            sessionManager: self.sessionManager,
            rootViewController: self.window?.rootViewController as! UISplitViewController
        )
    }()

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        // initialize a webview at the start so webview startup later on isn't so slow
        let _ = UIWebView()
        flexController.configureWindow(window)
        window?.backgroundColor = Styles.Colors.background
        rootNavigationManager.resetRootViewController(userSession: sessionManager.userSession)
        NetworkActivityIndicatorManager.shared.isEnabled = true
        return true
    }

    func applicationDidBecomeActive(_ application: UIApplication) {
        if showingLogin == false && sessionManager.userSession == nil {
            showingLogin = true
            rootNavigationManager.showLogin(animated: false)
        }
    }

    func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
        if let sourceApp = options[.sourceApplication],
            String(describing: sourceApp) == "com.apple.SafariViewService" {
            sessionManager.receivedCodeRedirect(url: url)
            return true
        }
        return false
    }
    
}

{'fraction_non_alphanumeric': 0.07877984084880636, 'fraction_numerical': 0.004774535809018567, 'mean_word_length': 3.0944625407166124, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, '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': '1058372', 'n_tokens_mistral': 972, 'n_tokens_neox': 930, 'n_words': 247}