<commit_before>
import UIKit
import SwiftIconFont
import TTTAttributedLabel

open class GLabel: UILabel {
    private var helper : ViewHelper!
    private var isUnderlined = false
    private var onClick : ((GLabel) -> Void)?

    public override init(frame: CGRect) {
        super.init(frame: frame)
        initialize()
    }
    
    required public init?(coder: NSCoder) {
        super.init(coder: coder)
        initialize()
    }
    
    private func initialize() {
        self.helper = ViewHelper(self)
    }
    
    open override func didMoveToSuperview() {
        super.didMoveToSuperview()
        helper.didMoveToSuperview()
    }
    
    public func color(_ color: UIColor) -> Self {
        self.textColor = color
        return self
    }
    
    public func color(bg : UIColor?, text: UIColor? = nil) -> Self {
        if let bgColor = bg {
            self.backgroundColor = bgColor
        }
        if let textColor = text {
            self.textColor = textColor
        }
        return self
    }
    
    public func text(_ text : String) -> Self {
        self.numberOfLines = 0
        self.text = text
        return self
    }
    
    public func icon(_ icon: String, size: CGFloat) -> Self {
        self.numberOfLines = 0
        self.text = icon
        self.font = self.font.withSize(size)
        self.parseIcon()
        return self
    }
    
    // Has to be called before text()
    public func font(_ font: UIFont?, size: Float? = nil, traits: UIFontDescriptorSymbolicTraits...) -> Self {
        var f = (font ?? self.font).withTraits(traits)
        if let s = size {
            f = f.withSize(CGFloat(s))
        }
        self.font = f
        return self
    }
    
//    public func font(size: Float? = nil, traits: UIFontDescriptorSymbolicTraits...) -> Self {
//        var f = self.font.withTraits(traits)
//        if let s = size {
//           f = f.withSize(CGFloat(s))
//        }
////        if let t = traits {
////            f = f.withTraits(traits)
////        }
//        return font(f)
//    }

    // TODO: Consider deprecating this, but how about underline()
    public func bold() -> Self {
        return font(self.font.bold())
    }
    
//    public func size(w: Int?, h: Int?) -> Self {
//        helper.size(width: w, height: h)
//        return self
//    }<commit_msg>cleanup<commit_after>
import UIKit
import SwiftIconFont
import TTTAttributedLabel

open class GLabel: UILabel {
    private var helper : ViewHelper!
    private var isUnderlined = false
    private var onClick : ((GLabel) -> Void)?

    public override init(frame: CGRect) {
        super.init(frame: frame)
        initialize()
    }
    
    required public init?(coder: NSCoder) {
        super.init(coder: coder)
        initialize()
    }
    
    private func initialize() {
        self.helper = ViewHelper(self)
    }
    
    open override func didMoveToSuperview() {
        super.didMoveToSuperview()
        helper.didMoveToSuperview()
    }
    
    public func color(_ color: UIColor) -> Self {
        self.textColor = color
        return self
    }
    
    public func color(bg : UIColor?, text: UIColor? = nil) -> Self {
        if let bgColor = bg {
            self.backgroundColor = bgColor
        }
        if let textColor = text {
            self.textColor = textColor
        }
        return self
    }
    
    public func text(_ text : String) -> Self {
        self.numberOfLines = 0
        self.text = text
        return self
    }
    
    public func icon(_ icon: String, size: CGFloat) -> Self {
        self.numberOfLines = 0
        self.text = icon
        self.font = self.font.withSize(size)
        self.parseIcon()
        return self
    }
    
    // Has to be called before text()
    public func font(_ font: UIFont?, size: Float? = nil, traits: UIFontDescriptorSymbolicTraits...) -> Self {
        var f = (font ?? self.font).withTraits(traits)
        if let s = size {
            f = f.withSize(CGFloat(s))
        }
        self.font = f
        return self
    }
{'fraction_non_alphanumeric': 0.10588524993843881, 'fraction_numerical': 0.0009849790691947797, 'mean_word_length': 1.7595108695652173, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 18, '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': '5504717', 'n_tokens_mistral': 1216, 'n_tokens_neox': 1208, 'n_words': 334}