<commit_before>import Foundation

protocol ArticleContextMenuPresenting {
    // For Context Menus (used in iOS 13 and later)
    @available(iOS 13.0, *)
    func getPeekViewControllerAsync(for destination: Router.Destination, completion: @escaping (UIViewController?) -> Void)

    // Used for both Context Menus and Peek/Pop
    func hideFindInPage(_ completion: (() -> Void)?)
    var configuration: Configuration { get }

    //  For Peek/Pop (used by iOS 12 and earlier, can be removed when the oldest supported version is iOS 13)
    func getPeekViewController(for destination: Router.Destination) -> UIViewController?
}

enum ContextMenuCompletionType {
    case bail
    case timeout
    case success
}

// MARK:- Context Menu for Protocol (iOS 13 and later)
// All functions in this extension are for Context Menus (used in iOS 13 and later)
/// The ArticleContextMenuPresenting protocol extension has functions that are called by various classes'  WKUIDelegate functions, but the WKUIDelegate functions themselves
/// reside within the actual classes. This is because in testing, the degate methods were never called when they lived in the protocol extension - there would just be a silent failure.
/// Thus, there is some dupicated code in the actual classes for receiving the delegate calls, and those functions in turn call the shared code within this protocol extension.
/// More details: https://phabricator.wikimedia.org/T253891#6173598
@available(iOS 13.0, *)
extension ArticleContextMenuPresenting {
    func contextMenuConfigurationForElement(_ elementInfo: WKContextMenuElementInfo, completionHandler: @escaping (UIContextMenuConfiguration?) -> Void) {
        let nullConfig = UIContextMenuConfiguration(identifier: nil, previewProvider: nil)

        let nullCompletion = {
            completionHandler(nullConfig)
        }
<commit_msg>Fix minor typos in comment.<commit_after>import Foundation

protocol ArticleContextMenuPresenting {
    // For Context Menus (used in iOS 13 and later)
    @available(iOS 13.0, *)
    func getPeekViewControllerAsync(for destination: Router.Destination, completion: @escaping (UIViewController?) -> Void)

    // Used for both Context Menus and Peek/Pop
    func hideFindInPage(_ completion: (() -> Void)?)
    var configuration: Configuration { get }

    //  For Peek/Pop (used by iOS 12 and earlier, can be removed when the oldest supported version is iOS 13)
    func getPeekViewController(for destination: Router.Destination) -> UIViewController?
}

enum ContextMenuCompletionType {
    case bail
    case timeout
    case success
}

// MARK:- Context Menu for Protocol (iOS 13 and later)
// All functions in this extension are for Context Menus (used in iOS 13 and later)
/// The ArticleContextMenuPresenting protocol extension has functions that are called by various classes' WKUIDelegate functions, but the WKUIDelegate functions themselves
/// reside within the actual classes. This is because in testing, the delegate methods were never called when they lived in the protocol extension - there would just be a silent failure.
/// Thus, there is some duplicated code in the actual classes for receiving the delegate calls, and those functions in turn call the shared code within this protocol extension.
/// More details: https://phabricator.wikimedia.org/T253891#6173598
@available(iOS 13.0, *)
extension ArticleContextMenuPresenting {
    func contextMenuConfigurationForElement(_ elementInfo: WKContextMenuElementInfo, completionHandler: @escaping (UIContextMenuConfiguration?) -> Void) {
        let nullConfig = UIContextMenuConfiguration(identifier: nil, previewProvider: nil)

        let nullCompletion = {
            completionHandler(nullConfig)
        }

{'fraction_non_alphanumeric': 0.06825481798715204, 'fraction_numerical': 0.015524625267665952, 'mean_word_length': 4.1830790568654646, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 2, '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': '2973316', 'n_tokens_mistral': 970, 'n_tokens_neox': 893, 'n_words': 394}