<commit_before>//
//  UIKit+Helpers.swift
//
//  Created by <NAME> on 9/12/16.
//
//

import UIKit

extension UIFont {

    @nonobjc static func bon_preferredFont(forTextStyle textStyle: BonMotTextStyle, compatibleWith traitCollection: UITraitCollection?) -> UIFont {
        if #available(iOS 10.0, *) {
            return preferredFont(forTextStyle: textStyle, compatibleWith: traitCollection)
        }
        else {
            return preferredFont(forTextStyle: textStyle)
        }
    }

    @objc(bon_textStyle)
    public final var textStyle: BonMotTextStyle? {
        guard let textStyle = fontDescriptor.fontAttributes[UIFontDescriptorTextStyleAttribute] as? String else {
            return nil
        }
        #if swift(>=3.0)
            return UIFontTextStyle(rawValue: textStyle)
        #else
            return textStyle
        #endif
    }
}

extension UITraitCollection {

    /// Obtain the preferredContentSizeCategory for the trait collection. This is compatible with iOS 9.x
    /// and will use the UIApplication preferredContentSizeCategory if the trait collections
    /// preferredContentSizeCategory is UIContentSizeCategoryUnspecified.
    public var bon_preferredContentSizeCategory: BonMotContentSizeCategory {
        #if swift(>=3.0)
            if #available(iOS 10.0, *) {
                if preferredContentSizeCategory != .unspecified {
                    return preferredContentSizeCategory
                }
            }
        #elseif swift(>=2.3)
            if #available(iOS 10.0, *) {
                if preferredContentSizeCategory != UIContentSizeCategoryUnspecified {<commit_msg>Match tvOS and iOS deployment target<commit_after>//
//  UIKit+Helpers.swift
//
//  Created by <NAME> on 9/12/16.
//
//

import UIKit

extension UIFont {

    @nonobjc static func bon_preferredFont(forTextStyle textStyle: BonMotTextStyle, compatibleWith traitCollection: UITraitCollection?) -> UIFont {
        if #available(iOS 10.0, tvOS 10.0, *) {
            return preferredFont(forTextStyle: textStyle, compatibleWith: traitCollection)
        }
        else {
            return preferredFont(forTextStyle: textStyle)
        }
    }

    @objc(bon_textStyle)
    public final var textStyle: BonMotTextStyle? {
        guard let textStyle = fontDescriptor.fontAttributes[UIFontDescriptorTextStyleAttribute] as? String else {
            return nil
        }
        #if swift(>=3.0)
            return UIFontTextStyle(rawValue: textStyle)
        #else
            return textStyle
        #endif
    }
}

extension UITraitCollection {

    /// Obtain the preferredContentSizeCategory for the trait collection. This is compatible with iOS 9.x
    /// and will use the UIApplication preferredContentSizeCategory if the trait collections
    /// preferredContentSizeCategory is UIContentSizeCategoryUnspecified.
    public var bon_preferredContentSizeCategory: BonMotContentSizeCategory {
        #if swift(>=3.0)
            if #available(iOS 10.0, tvOS 10.0, *) {
                if preferredContentSizeCategory != .unspecified {
                    return preferredContentSizeCategory
                }
            }
        #elseif swift(>=2.3)
            if #available(iOS 10.0, *) {
                if preferredContentSizeCategory != UIContentSizeCategoryUnspecified {
{'fraction_non_alphanumeric': 0.0784313725490196, 'fraction_numerical': 0.014479638009049774, 'mean_word_length': 2.4541666666666666, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '951235', 'n_tokens_mistral': 917, 'n_tokens_neox': 872, 'n_words': 223}