<commit_before>//
//  ReactorListViewController.swift
//  Rocket.Chat
//
//  Created by <NAME> on 2/5/18.
//  Copyright © 2018 Rocket.Chat. All rights reserved.
//

import Foundation

class ReactorListViewController: UIViewController {
    override var preferredContentSize: CGSize {
        set { }
        get {
            reactorListView.layoutIfNeeded()
            let height = min(reactorListView.reactorTableView.contentSize.height, 400)
            let width = CGFloat(300)
            return CGSize(width: width, height: height)
        }
    }

    var model: ReactorListViewModel = .emptyState {
        didSet {
            reactorListView?.model = model
        }
    }

    var reactorListView: ReactorListView! {
        didSet {
            reactorListView.closePressed = {
                self.dismiss(animated: true, completion: nil)
            }

            reactorListView.model = model
        }
    }

    func close(animated: Bool) {
        if navigationController?.topViewController == self {
            navigationController?.popViewController(animated: animated)
        } else {
            dismiss(animated: animated)
        }
    }

    override func loadView() {
        super.loadView()

        reactorListView = ReactorListView(frame: view.frame)
        reactorListView.translatesAutoresizingMaskIntoConstraints = false

        view.addSubview(reactorListView)

        view.addConstraints(
            NSLayoutConstraint.constraints(
                withVisualFormat: "|-0-[view]-0-|", options: [], metrics: nil, views: ["view": reactorListView]
            )
        )
        view.addConstraints(
            NSLayoutConstraint.constraints(
                withVisualFormat: "V:|-0-[view]-0-|", options: [], metrics: nil, views: ["view": reactorListView]
            )
        )

        title = NSLocalizedString("reactorlist.title", tableName: "RCEmojiKit", bundle: Bundle.main, value: "", comment: "")
    }

    override func viewWillAppear(_ animated: Bool) {
        
        // remove title from back button

        if self.navigationController?.topViewController == self {
            navigationController?.navigationBar.topItem?.title = ""
        }
    }
}<commit_msg>Remo whitespace<commit_after>//
//  ReactorListViewController.swift
//  Rocket.Chat
//
//  Created by <NAME> on 2/5/18.
//  Copyright © 2018 Rocket.Chat. All rights reserved.
//

import Foundation

class ReactorListViewController: UIViewController {
    override var preferredContentSize: CGSize {
        set { }
        get {
            reactorListView.layoutIfNeeded()
            let height = min(reactorListView.reactorTableView.contentSize.height, 400)
            let width = CGFloat(300)
            return CGSize(width: width, height: height)
        }
    }

    var model: ReactorListViewModel = .emptyState {
        didSet {
            reactorListView?.model = model
        }
    }

    var reactorListView: ReactorListView! {
        didSet {
            reactorListView.closePressed = {
                self.dismiss(animated: true, completion: nil)
            }

            reactorListView.model = model
        }
    }

    func close(animated: Bool) {
        if navigationController?.topViewController == self {
            navigationController?.popViewController(animated: animated)
        } else {
            dismiss(animated: animated)
        }
    }

    override func loadView() {
        super.loadView()

        reactorListView = ReactorListView(frame: view.frame)
        reactorListView.translatesAutoresizingMaskIntoConstraints = false

        view.addSubview(reactorListView)

        view.addConstraints(
            NSLayoutConstraint.constraints(
                withVisualFormat: "|-0-[view]-0-|", options: [], metrics: nil, views: ["view": reactorListView]
            )
        )
        view.addConstraints(
            NSLayoutConstraint.constraints(
                withVisualFormat: "V:|-0-[view]-0-|", options: [], metrics: nil, views: ["view": reactorListView]
            )
        )

        title = NSLocalizedString("reactorlist.title", tableName: "RCEmojiKit", bundle: Bundle.main, value: "", comment: "")
    }

    override func viewWillAppear(_ animated: Bool) {

        // remove title from back button

        if self.navigationController?.topViewController == self {
            navigationController?.navigationBar.topItem?.title = ""
        }
    }
}
{'fraction_non_alphanumeric': 0.10184767913474538, 'fraction_numerical': 0.00811176205497972, 'mean_word_length': 2.126056338028169, 'pattern_counts': {'":': 4, '<': 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': '6442893', 'n_tokens_mistral': 1273, 'n_tokens_neox': 1148, 'n_words': 241}