<commit_before>////
///  BadgeCell.swift
//

import SnapKit


class BadgeCell: CollectionViewCell {
    static let reuseIdentifier = "BadgeCell"

    struct Size {
        static let imageLeftMargin: CGFloat = 20
        static let imageSize = CGSize(width: 24, height: 24)
        static let grayInsets = UIEdgeInsets(top: 0, left: 15, bottom: 0, right: 15)
        static let labelMargin: CGFloat = 20
    }

    var title: String? {
        set { label.text = newValue }
        get { return label.text }
    }
    var attributedTitle: NSAttributedString? {
        set { label.attributedText = newValue }
        get { return label.attributedText }
    }
    var url: URL?
    var imageURL: URL? {
        didSet {
            guard let imageURL = imageURL else {
                imageView.pin_cancelImageDownload()
                imageView.image = nil
                return
            }
            imageView.pin_setImage(from: imageURL)
        }
    }

    fileprivate let label = ElloTextView()
    fileprivate let imageView = UIImageView()
    fileprivate let grayLine = UIImageView()

    override func prepareForReuse() {
        super.prepareForReuse()
        label.text = ""
        imageView.image = nil
        url = nil
    }

    override func style() {
        label.textViewDelegate = self
        label.backgroundColor = .clear
        label.isEditable = false
        label.allowsEditingTextAttributes = false
        label.isSelectable = false
        label.textColor = .black
        imageView.contentMode = .scaleAspectFill<commit_msg>fix animated badge gif<commit_after>////
///  BadgeCell.swift
//

import SnapKit
import FLAnimatedImage


class BadgeCell: CollectionViewCell {
    static let reuseIdentifier = "BadgeCell"

    struct Size {
        static let imageLeftMargin: CGFloat = 20
        static let imageSize = CGSize(width: 24, height: 24)
        static let grayInsets = UIEdgeInsets(top: 0, left: 15, bottom: 0, right: 15)
        static let labelMargin: CGFloat = 20
    }

    var title: String? {
        set { label.text = newValue }
        get { return label.text }
    }
    var attributedTitle: NSAttributedString? {
        set { label.attributedText = newValue }
        get { return label.attributedText }
    }
    var url: URL?
    var imageURL: URL? {
        didSet {
            guard let imageURL = imageURL else {
                imageView.pin_cancelImageDownload()
                imageView.image = nil
                return
            }
            imageView.pin_setImage(from: imageURL)
        }
    }

    fileprivate let label = ElloTextView()
    fileprivate let imageView = FLAnimatedImageView()
    fileprivate let grayLine = UIView()

    override func prepareForReuse() {
        super.prepareForReuse()
        label.text = ""
        imageView.image = nil
        url = nil
    }

    override func style() {
        label.textViewDelegate = self
        label.backgroundColor = .clear
        label.isEditable = false
        label.allowsEditingTextAttributes = false
        label.isSelectable = false
        label.textColor = .black
        imageView.contentMode = .scaleAspectFill
{'fraction_non_alphanumeric': 0.07908889591901297, 'fraction_numerical': 0.008857956342929452, 'mean_word_length': 2.034548944337812, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2754444', 'n_tokens_mistral': 931, 'n_tokens_neox': 870, 'n_words': 234}