<commit_before>extension UITableViewController {
    fileprivate func scrollToFirstIndexPath() {
        tableView.scrollToRow(at: IndexPath(row: 0, section: 0) , at: .top, animated: true)
    }
}

extension UICollectionViewController {
    fileprivate func scrollToFirstIndexPath() {
        collectionView?.scrollToItem(at: IndexPath(row: 0, section: 0) , at: .top, animated: true)
    }
}

extension ArticleCollectionViewController {
    @objc func scrollToTop(_ isScrollable: Bool) {
        guard isScrollable else { return }
        scrollToFirstIndexPath()
    }
}

extension ExploreViewController {
    @objc func scrollToTop() {
        guard collectionViewController.canScrollToTop else { return }
        collectionViewController.scrollToFirstIndexPath()
        showSearchBar(animated: true)
    }
}<commit_msg>fix scroll to top calculation for collection view<commit_after>extension UITableViewController {
    fileprivate func scrollToFirstIndexPath() {
        tableView.scrollToRow(at: IndexPath(row: 0, section: 0) , at: .top, animated: true)
    }
}

extension UICollectionViewController {
    fileprivate func scrollToTop() {
        guard let collectionView = self.collectionView else {
            return
        }
        collectionView.setContentOffset(CGPoint(x: collectionView.contentOffset.x, y: 0 - collectionView.contentInset.top), animated: true)
    }
}

extension ArticleCollectionViewController {
    @objc func scrollToTop(_ isScrollable: Bool) {
        guard isScrollable else { return }
        scrollToTop()
    }
}

extension ExploreViewController {
    @objc func scrollToTop() {
        guard collectionViewController.canScrollToTop else { return }
        collectionViewController.scrollToTop()
        showSearchBar(animated: true)
    }
}
{'fraction_non_alphanumeric': 0.08309938236945537, 'fraction_numerical': 0.0039303761931499155, 'mean_word_length': 3.5927835051546393, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6810669', 'n_tokens_mistral': 499, 'n_tokens_neox': 478, 'n_words': 115}