<commit_before>import UIKit

class TabbyBadge: UIView {

  var setNumber: Int = 0 {
    didSet {
      var text = "\(setNumber)"
      if setNumber >= 99 {
        text = "+99"
      }

      visible = setNumber > 0
      numberLabel.text = text

      setupConstraints()
    }
  }

  var visible: Bool = false {
    didSet {
      alpha = visible ? 1 : 0
    }
  }

  lazy var numberLabel: UILabel = {
    let label = UILabel()
    label.font = Constant.Font.badge
    label.textColor = Constant.Color.Badge.text
    label.textAlignment = .center
    label.text = "0"

    return label
  }()

  override init(frame: CGRect) {
    super.init(frame: frame)

    backgroundColor = Constant.Color.Badge.background
    
    layer.cornerRadius = Constant.Dimension.Badge.size / 2
    layer.borderColor = UIColor.white.cgColor
    layer.borderWidth = 2

    setupConstraints()
  }
  
  required init?(coder aDecoder: NSCoder) {
    fatalError("init(coder:) has not been implemented")
  }

  // MARK: - Constraints

  func setupConstraints() {
    numberLabel.translatesAutoresizingMaskIntoConstraints = false
    numberLabel.removeFromSuperview()<commit_msg>Configures the initial setup of a property<commit_after>import UIKit

class TabbyBadge: UIView {

  var setNumber: Int = 0 {
    didSet {
      var text = "\(setNumber)"
      if setNumber >= 99 {
        text = "+99"
      }

      visible = setNumber > 0
      numberLabel.text = text

      setupConstraints()
    }
  }

  var visible: Bool = false {
    didSet {
      alpha = visible ? 1 : 0
    }
  }

  lazy var numberLabel: UILabel = {
    let label = UILabel()
    label.font = Constant.Font.badge
    label.textColor = Constant.Color.Badge.text
    label.textAlignment = .center

    return label
  }()

  override init(frame: CGRect) {
    super.init(frame: frame)

    defer {
      setNumber = 0
    }

    backgroundColor = Constant.Color.Badge.background
    
    layer.cornerRadius = Constant.Dimension.Badge.size / 2
    layer.borderColor = UIColor.white.cgColor
    layer.borderWidth = 2

    setupConstraints()
  }
  
  required init?(coder aDecoder: NSCoder) {
    fatalError("init(coder:) has not been implemented")
  }

  // MARK: - Constraints

  func setupConstraints() {
    numberLabel.translatesAutoresizingMaskIntoConstraints = false
    numberLabel.removeFromSuperview()
{'fraction_non_alphanumeric': 0.09910676307954062, 'fraction_numerical': 0.009357720119098255, 'mean_word_length': 2.5315315315315314, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '4528495', 'n_tokens_mistral': 771, 'n_tokens_neox': 725, 'n_words': 168}