<commit_before>
import Foundation
import UIKit

public enum UIViewControllerTransition {
    
    case FlowFromRight
    case PushToBack
}

extension UIStoryboard {
    
    public class func controllerWithIdentifier(identifier: String) -> AnyObject {
        
        let application = UIApplication.sharedApplication()
        
        let backWindow = application.windows[0]
        
        let storyBoard = backWindow.rootViewController!.storyboard
        
        return storyBoard!.instantiateViewControllerWithIdentifier(identifier)
    }
}


extension UIViewController {
    
    public var navController: UINavigationController {
        
        get {
            return self.navigationController!
        }
    }

    public func setRightButtonItem(item: UIBarButtonItem?) {
        
        self.navigationItem.rightBarButtonItem = item
    }
    
    public func setLeftButtonItem(item: UIBarButtonItem?) {
        
        self.navigationItem.leftBarButtonItem = item
    }
    
    public func pushViewController(viewController: UIViewController) {
        
        self.navController.pushViewController(viewController, animated: true)
    }
    
    
    public func insertViewController(controller: UIViewController, belowViewController: UIViewController, withTransition: UIViewControllerTransition, duration: NSTimeInterval) {
        
        
    }
    
    public func presentViewControllerNonAnimated(viewController: UIViewController) {
        
        presentViewController(viewController, animated: false, completion: nil)

    }

    public func presentViewController(viewController: UIViewController) {
        <commit_msg>Quick fix for nav controller crash when trying to use push view controller helper method<commit_after>
import Foundation
import UIKit

public enum UIViewControllerTransition {
    
    case FlowFromRight
    case PushToBack
}

extension UIStoryboard {
    
    public class func controllerWithIdentifier(identifier: String) -> AnyObject {
        
        let application = UIApplication.sharedApplication()
        
        let backWindow = application.windows[0]
        
        let storyBoard = backWindow.rootViewController!.storyboard
        
        return storyBoard!.instantiateViewControllerWithIdentifier(identifier)
    }
}


extension UIViewController {
    
    public var navController: UINavigationController {
        
        get {
            return self.navigationController!
        }
    }

    public func setRightButtonItem(item: UIBarButtonItem?) {
        
        self.navigationItem.rightBarButtonItem = item
    }
    
    public func setLeftButtonItem(item: UIBarButtonItem?) {
        
        self.navigationItem.leftBarButtonItem = item
    }
    
    public func pushViewController(viewController: UIViewController) {
        
        if self is UINavigationController {
            
            let controller = self as! UINavigationController
            controller.pushViewController(viewController, animated: true)
        } else {
            
            self.navController.pushViewController(viewController, animated: true)

        }
    }
    
    
    public func insertViewController(controller: UIViewController, belowViewController: UIViewController, withTransition: UIViewControllerTransition, duration: NSTimeInterval) {
        
        
    }
    
    public func presentViewControllerNonAnimated(viewController: UIViewController) {
        
        presentViewController(viewController, animated: false, completion: nil)

    }

    public func presentViewController(viewController: UIViewController) {
        
{'fraction_non_alphanumeric': 0.05448008849557522, 'fraction_numerical': 0.0005530973451327434, 'mean_word_length': 2.6646403242147922, 'pattern_counts': {'":': 0, '<': 3, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4225081', 'n_tokens_mistral': 879, 'n_tokens_neox': 828, 'n_words': 191}