<commit_before>//
//  MockCollectionView.swift
//  FURRDataSource
//
//  Created by <NAME> on 14.01.16.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import UIKit

class MockCollectionView: UICollectionView {

    var insertRowsCallback: ((indexPaths: [NSIndexPath]) -> Void)?
    var deleteRowsCallback: ((indexPaths: [NSIndexPath]) -> Void)?
    var insertSectionsCallback: ((indexSet: NSIndexSet) -> Void)?
    var deleteSectionsCallback: ((indexSet: NSIndexSet) -> Void)?

    var insertionRowIndexPaths: [NSIndexPath] = []
    var deletionRowIndexPaths: [NSIndexPath] = []
    var insertionSectionIndexSet: NSMutableIndexSet = NSMutableIndexSet()
    var deletionSectionIndexSet: NSMutableIndexSet = NSMutableIndexSet()

    override func insertSections(sections: NSIndexSet) {
        self.insertionSectionIndexSet.addIndexes(sections)
        if let callback = insertSectionsCallback {
            callback(indexSet: sections)
        }
        super.insertSections(sections)
    }

    override func deleteSections(sections: NSIndexSet) {
        self.deletionSectionIndexSet.addIndexes(sections)
        if let callback = deleteSectionsCallback {
            callback(indexSet: sections)
        }
        super.deleteSections(sections)
    }

    override func insertItemsAtIndexPaths(indexPaths: [NSIndexPath]) {
        self.insertionRowIndexPaths.appendContentsOf(indexPaths)
        if let callback = self.insertRowsCallback {
            callback(indexPaths: indexPaths)
        }
        super.insertItemsAtIndexPaths(indexPaths)
    }

    override func deleteItemsAtIndexPaths(indexPaths: [NSIndexPath]) {
        self.deletionRowIndexPaths.appendContentsOf(indexPaths)
        if let callback = self.deleteRowsCallback {
            callback(indexPaths: indexPaths)
        }
        super.deleteItemsAtIndexPaths(indexPaths)
    }
}

class MockCollectionViewCell: UICollectionViewCell {
}<commit_msg>fix MockCollectonView for swift3<commit_after>//
//  MockCollectionView.swift
//  FURRDataSource
//
//  Created by <NAME> on 14.01.16.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import UIKit

class MockCollectionView: UICollectionView {

    var insertRowsCallback: ((indexPaths: [IndexPathway]) -> Void)?
    var deleteRowsCallback: ((indexPaths: [IndexPathway]) -> Void)?
    var insertSectionsCallback: ((indexSet: NSIndexSet) -> Void)?
    var deleteSectionsCallback: ((indexSet: NSIndexSet) -> Void)?

    var insertionRowIndexPaths: [IndexPathway] = []
    var deletionRowIndexPaths: [IndexPathway] = []
    var insertionSectionIndexSet: NSMutableIndexSet = NSMutableIndexSet()
    var deletionSectionIndexSet: NSMutableIndexSet = NSMutableIndexSet()

    #if swift(>=3.0)
    override func insertSections(_ sections: IndexSet) {
        self.insertionSectionIndexSet.add(sections)
        if let callback = insertSectionsCallback {
            callback(indexSet: sections)
        }
        super.insertSections(sections)
    }
    #else
    override func insertSections(sections: NSIndexSet) {
        self.insertionSectionIndexSet.addIndexes(sections)
        if let callback = insertSectionsCallback {
            callback(indexSet: sections)
        }
        super.insertSections(sections)
    }
    #endif

    #if swift(>=3.0)
    override func deleteSections(_ sections: IndexSet) {
        self.deletionSectionIndexSet.add(sections)
        if let callback = deleteSectionsCallback {
            callback(indexSet: sections)
        }
        super.deleteSections(sections)
    }
    #else
    override func deleteSections(sections: NSIndexSet) {
        self.deletionSectionIndexSet.addIndexes(sections)
        if let callback = deleteSectionsCallback {
            callback(indexSet: sections)
        }
        super.deleteSections(sections)
    }
    #endif

    #if swift(>=3.0)
    override func insertItems(at indexPaths: [IndexPath]) {
        self.insertionRowIndexPaths.append(contentsOf: indexPaths)
        if let callback = self.insertRowsCallback {
            callback(indexPaths: indexPaths)
        }
        super.insertItems(at: indexPaths)
    }
    #else
    override func insertItemsAtIndexPaths(indexPaths: [NSIndexPath]) {
        self.insertionRowIndexPaths.appendContentsOf(indexPaths)
        if let callback = self.insertRowsCallback {
            callback(indexPaths: indexPaths)
        }
        super.insertItemsAtIndexPaths(indexPaths)
    }
    #endif

    #if swift(>=3.0)
    override func deleteItems(at indexPaths: [IndexPath]) {
        self.deletionRowIndexPaths.append(contentsOf: indexPaths)
        if let callback = self.deleteRowsCallback {
            callback(indexPaths: indexPaths)
        }
        super.deleteItems(at: indexPaths)
    }
    #else
    override func deleteItemsAtIndexPaths(indexPaths: [NSIndexPath]) {
        self.deletionRowIndexPaths.appendContentsOf(indexPaths)
        if let callback = self.deleteRowsCallback {
            callback(indexPaths: indexPaths)
        }
        super.deleteItemsAtIndexPaths(indexPaths)
    }
    #endif
}

class MockCollectionViewCell: UICollectionViewCell {
}
{'fraction_non_alphanumeric': 0.089435657098223, 'fraction_numerical': 0.005662956453817614, 'mean_word_length': 3.1306451612903228, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 19, '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': '1069632', 'n_tokens_mistral': 1466, 'n_tokens_neox': 1396, 'n_words': 285}