<commit_before>// The MIT License (MIT)
//
// Copyright (c) 2015-2020 <NAME> (github.com/kean).

import Foundation
import Nuke

extension ImagePipeline.Error: Equatable {
    public static func == (lhs: ImagePipeline.Error, rhs: ImagePipeline.Error) -> Bool {
        switch (lhs, rhs) {
        case let (.dataLoadingFailed(lhs), .dataLoadingFailed(rhs)):
            return lhs as NSError == rhs as NSError
        case (.decodingFailed, .decodingFailed): return true
        case (.processingFailed, .processingFailed): return true
        default: return false
        }
    }
}

extension ImageTaskEvent: Equatable {
    public static func == (lhs: ImageTaskEvent, rhs: ImageTaskEvent) -> Bool {
        switch (lhs, rhs) {
        case (.started, .started): return true
        case (.cancelled, .cancelled): return true
        case let (.priorityUpdated(lhs), .priorityUpdated(rhs)): return lhs == rhs
        case let (.intermediateResponseReceived(lhs), .intermediateResponseReceived(rhs)): return lhs == rhs
        case let (.progressUpdated(lhs), .progressUpdated(rhs)): return lhs == rhs
        case let (.completed(lhs), .completed(rhs)): return lhs == rhs
        default: return false
        }
    }
}

extension ImageResponse: Equatable {
    public static func == (lhs: ImageResponse, rhs: ImageResponse) -> Bool {
        return lhs === rhs
    }
}

extension ImagePipeline {
    func reconfigured(_ configure: (inout ImagePipeline.Configuration) -> Void) -> ImagePipeline {
        var configuration = self.configuration
        configure(&configuration)
        return ImagePipeline(configuration: configuration)
    }
}

extension ImagePipeline {
    private static var stack = [ImagePipeline]()

    static func pushShared(_ shared: ImagePipeline) {
        stack.append(ImagePipeline.shared)
        ImagePipeline.shared = shared
    }

    static func popShared() {
        ImagePipeline.shared = stack.removeLast()
    }
}

extension ImageLoadingOptions {
    private static var stack = [ImageLoadingOptions]()

    static func pushShared(_ shared: ImageLoadingOptions) {
        stack.append(ImageLoadingOptions.shared)
        ImageLoadingOptions.shared = shared
    }

    static func popShared() {
        ImageLoadingOptions.shared = stack.removeLast()
    }
}

#if os(macOS)
import Cocoa
typealias _ImageView = NSImageView
#else
import UIKit
typealias _ImageView = UIImageView
#endif
<commit_msg>Fix warnings in unit test target<commit_after>// The MIT License (MIT)
//
// Copyright (c) 2015-2020 <NAME> (github.com/kean).

import Foundation
import Nuke

extension ImagePipeline.Error: Equatable {
    public static func == (lhs: ImagePipeline.Error, rhs: ImagePipeline.Error) -> Bool {
        switch (lhs, rhs) {
        case let (.dataLoadingFailed(lhs), .dataLoadingFailed(rhs)):
            return lhs as NSError == rhs as NSError
        case (.decodingFailed, .decodingFailed): return true
        case (.processingFailed, .processingFailed): return true
        default: return false
        }
    }
}

extension ImageTaskEvent: Equatable {
    public static func == (lhs: ImageTaskEvent, rhs: ImageTaskEvent) -> Bool {
        switch (lhs, rhs) {
        case (.started, .started): return true
        case (.cancelled, .cancelled): return true
        case let (.priorityUpdated(lhs), .priorityUpdated(rhs)): return lhs == rhs
        case let (.intermediateResponseReceived(lhs), .intermediateResponseReceived(rhs)): return lhs == rhs
        case let (.progressUpdated(lhsTotal, lhsCompleted), .progressUpdated(rhsTotal, rhsCompleted)):
            return (lhsTotal, lhsCompleted) == (rhsTotal, rhsCompleted)
        case let (.completed(lhs), .completed(rhs)): return lhs == rhs
        default: return false
        }
    }
}

extension ImageResponse: Equatable {
    public static func == (lhs: ImageResponse, rhs: ImageResponse) -> Bool {
        return lhs === rhs
    }
}

extension ImagePipeline {
    func reconfigured(_ configure: (inout ImagePipeline.Configuration) -> Void) -> ImagePipeline {
        var configuration = self.configuration
        configure(&configuration)
        return ImagePipeline(configuration: configuration)
    }
}

extension ImagePipeline {
    private static var stack = [ImagePipeline]()

    static func pushShared(_ shared: ImagePipeline) {
        stack.append(ImagePipeline.shared)
        ImagePipeline.shared = shared
    }

    static func popShared() {
        ImagePipeline.shared = stack.removeLast()
    }
}

extension ImageLoadingOptions {
    private static var stack = [ImageLoadingOptions]()

    static func pushShared(_ shared: ImageLoadingOptions) {
        stack.append(ImageLoadingOptions.shared)
        ImageLoadingOptions.shared = shared
    }

    static func popShared() {
        ImageLoadingOptions.shared = stack.removeLast()
    }
}

#if os(macOS)
import Cocoa
typealias _ImageView = NSImageView
#else
import UIKit
typealias _ImageView = UIImageView
#endif

{'fraction_non_alphanumeric': 0.10134727528654736, 'fraction_numerical': 0.003217373818620551, 'mean_word_length': 3.1243781094527363, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '7359966', 'n_tokens_mistral': 1386, 'n_tokens_neox': 1328, 'n_words': 391}