<commit_before>//
//  Task.swift
//  Pods
//
//  Created by <NAME> on 27/12/16.
//
//

import Foundation

public class Task: NSObject {
    
    
    // MARK: - Types
    
    public enum State {
        
        // Running cases
        case notStarted, running, cancelling
        
        // Finished cases
        case successful, cancelled, failed
    }
    
    public enum Outcome {
        case success, cancelled, failure
    }
    
    
    // Helper object to give to work blocks so they can wrap things up and respond to cancellation
    public class Process {
        
        private weak var _task: Task?
        
        public var shouldCancel: Bool {
            return _task?.currentState == .cancelling
        }
        
        init(task: Task) {
            _task = task
        }
        
        public func progress(_ percent: Float) {
            _task?.reportProgress(percent)
        }
        
        public func succeed() {<commit_msg>Made the working queue accessible from the Progress object so you can use it deep within the details of your task (e.g. another async call needs a working or return queue)<commit_after>//
//  Task.swift
//  Pods
//
//  Created by <NAME> on 27/12/16.
//
//

import Foundation

public class Task: NSObject {
    
    
    // MARK: - Types
    
    public enum State {
        
        // Running cases
        case notStarted, running, cancelling
        
        // Finished cases
        case successful, cancelled, failed
    }
    
    public enum Outcome {
        case success, cancelled, failure
    }
    
    
    // Helper object to give to work blocks so they can wrap things up and respond to cancellation
    public class Process {
        
        private weak var _task: Task?
        public let workQueue: DispatchQueue
        
        public var shouldCancel: Bool {
            return _task?.currentState == .cancelling
        }
        
        init(task: Task) {
            _task = task
            workQueue = task.queueForWork
        }
        
        public func progress(_ percent: Float) {
            _task?.reportProgress(percent)
        }
        
        public func succeed() {
{'fraction_non_alphanumeric': 0.0711662075298439, 'fraction_numerical': 0.005509641873278237, 'mean_word_length': 1.5074798619102416, 'pattern_counts': {'":': 0, '<': 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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1646925', 'n_tokens_mistral': 583, 'n_tokens_neox': 566, 'n_words': 202}