<commit_before>//
//  SessionManager.swift
//  PhotoViewer
//
//  Created by <NAME> on 2/27/17.
//  Copyright © 2017 <NAME>. All rights reserved.
//

import Foundation
import UIKit

class SessionManager
{
    // TODO print logs
    static var sharedInstance = SessionManager()
    
    private var session: NSURLSession!
    
    init()
    {
        createSession()
    }
    
    // MARK: - Setup methods
    
    private func createSession()
    {
        let queue = NSOperationQueue()
        queue.name = "ServiceQueue"
        queue.maxConcurrentOperationCount = 4
        session = NSURLSession(configuration: NSURLSessionConfiguration.defaultSessionConfiguration(), delegate: nil, delegateQueue: queue)
    }
    
    // MARK: - Public methods
    
    func resetSession()
    {
        session = nil
        createSession()
    }
    
    func start(service: Service, suceedHandler: SuceedCompletionHandler, failedHandler: ErrorCompletionHandler)
    {<commit_msg>TODO removed<commit_after>//
//  SessionManager.swift
//  PhotoViewer
//
//  Created by <NAME> on 2/27/17.
//  Copyright © 2017 <NAME>. All rights reserved.
//

import Foundation
import UIKit

class SessionManager
{
    static var sharedInstance = SessionManager()
    
    private var session: NSURLSession!
    
    init()
    {
        createSession()
    }
    
    // MARK: - Setup methods
    
    private func createSession()
    {
        let queue = NSOperationQueue()
        queue.name = "ServiceQueue"
        queue.maxConcurrentOperationCount = 4
        session = NSURLSession(configuration: NSURLSessionConfiguration.defaultSessionConfiguration(), delegate: nil, delegateQueue: queue)
    }
    
    // MARK: - Public methods
    
    func resetSession()
    {
        session = nil
        createSession()
    }
    
    func start(service: Service, suceedHandler: SuceedCompletionHandler, failedHandler: ErrorCompletionHandler)
    {
{'fraction_non_alphanumeric': 0.09147609147609148, 'fraction_numerical': 0.010395010395010396, 'mean_word_length': 2.425266903914591, 'pattern_counts': {'":': 0, '<': 7, '<?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': '223350', 'n_tokens_mistral': 541, 'n_tokens_neox': 524, 'n_words': 136}