<commit_before>import UIKit

class VHomeFiltered:UIView
{
    weak var controller:CHomeFiltered!
    weak var bar:VHomeFilteredBar!
    weak var buttonExport:UIButton!
    private let kBarWidth:CGFloat = 180
    
    convenience init(controller:CHomeFiltered)
    {
        self.init()
        clipsToBounds = true
        backgroundColor = UIColor.white
        translatesAutoresizingMaskIntoConstraints = false
        self.controller = controller
        
        let barHeight:CGFloat = controller.parentController.viewParent.kBarHeight
        
        let blurEffect:UIBlurEffect = UIBlurEffect(style:UIBlurEffectStyle.light)
        let blur:UIVisualEffectView = UIVisualEffectView(effect:blurEffect)
        blur.isUserInteractionEnabled = false
        blur.translatesAutoresizingMaskIntoConstraints = false
        
        let background:UIImageView = UIImageView()
        background.isUserInteractionEnabled = false
        background.translatesAutoresizingMaskIntoConstraints = false
        background.clipsToBounds = true
        background.contentMode = UIViewContentMode.scaleAspectFill
        background.image = controller.image
        
        let imageView:UIImageView = UIImageView()
        imageView.isUserInteractionEnabled = false
        imageView.translatesAutoresizingMaskIntoConstraints = false
        imageView.clipsToBounds = true
        imageView.contentMode = UIViewContentMode.scaleAspectFit
        imageView.image = controller.image
        
        let bar:VHomeFilteredBar = VHomeFilteredBar(controller:controller)
        self.bar = bar
        
        let buttonExport:UIButton = UIButton()
        buttonExport.translatesAutoresizingMaskIntoConstraints = false
        buttonExport.setImage(
            #imageLiteral(resourceName: "assetGenericShare").withRenderingMode(UIImageRenderingMode.alwaysOriginal),
            for:UIControlState.normal)
        buttonExport.setImage(
            #imageLiteral(resourceName: "assetGenericShare").withRenderingMode(UIImageRenderingMode.alwaysTemplate),
            for:UIControlState.highlighted)
        buttonExport.imageView!.tintColor = UIColor.black
        buttonExport.imageView!.contentMode = UIViewContentMode.center
        buttonExport.imageView!.clipsToBounds = true
        buttonExport.imageEdgeInsets = UIEdgeInsetsMake(20, 18, 0, 0)
        buttonExport.addTarget(
            self,
            action:#selector(actionExport(sender:)),
            for:UIControlEvents.touchUpInside)
        self.buttonExport = buttonExport
        
        addSubview(background)
        addSubview(blur)
        addSubview(imageView)
        
        let views:[String:UIView] = [
            "imageView":imageView,
            "blur":blur,
            "background":background]
        
        let metrics:[String:CGFloat] = [
            "barHeight":barHeight]
        
        addConstraints(NSLayoutConstraint.constraints(
            withVisualFormat:"H:|-0-[imageView]-0-|",
            options:[],
            metrics:metrics,
            views:views))
        addConstraints(NSLayoutConstraint.constraints(
            withVisualFormat:"V:|-(barHeight)-[imageView]-0-|",
            options:[],
            metrics:metrics,
            views:views))
        addConstraints(NSLayoutConstraint.constraints(
            withVisualFormat:"H:|-0-[blur]-0-|",
            options:[],
            metrics:metrics,
            views:views))
        addConstraints(NSLayoutConstraint.constraints(
            withVisualFormat:"V:|-(barHeight)-[blur]-0-|",
            options:[],
            metrics:metrics,
            views:views))
        addConstraints(NSLayoutConstraint.constraints(
            withVisualFormat:"H:|-0-[background]-0-|",
            options:[],
            metrics:metrics,
            views:views))
        addConstraints(NSLayoutConstraint.constraints(
            withVisualFormat:"V:|-(barHeight)-[background]-0-|",
            options:[],
            metrics:metrics,
            views:views))
        
        let controllerBar:VBar = controller.parentController.viewParent.bar
        controllerBar.addSubview(buttonExport)
        
        let barViews:[String:UIView] = [
            "bar":bar]
        
        let barMetrics:[String:CGFloat] = [
            "barWidth":kBarWidth]
        
        controllerBar.addConstraints(NSLayoutConstraint.constraints(
            withVisualFormat:"H:[bar(barWidth)]-0-|",
            options:[],
            metrics:barMetrics,
            views:barViews))
        controllerBar.addConstraints(NSLayoutConstraint.constraints(
            withVisualFormat:"V:|-0-[bar]-0-|",
            options:[],
            metrics:barMetrics,
            views:barViews))
    }
    
    deinit
    {
        buttonExport.removeFromSuperview()
    }
}<commit_msg>using filtered bar instead of button export<commit_after>import UIKit

class VHomeFiltered:UIView
{
    weak var controller:CHomeFiltered!
    weak var bar:VHomeFilteredBar!
    private let kBarWidth:CGFloat = 180
    
    convenience init(controller:CHomeFiltered)
    {
        self.init()
        clipsToBounds = true
        backgroundColor = UIColor.white
        translatesAutoresizingMaskIntoConstraints = false
        self.controller = controller
        
        let barHeight:CGFloat = controller.parentController.viewParent.kBarHeight
        
        let blurEffect:UIBlurEffect = UIBlurEffect(style:UIBlurEffectStyle.light)
        let blur:UIVisualEffectView = UIVisualEffectView(effect:blurEffect)
        blur.isUserInteractionEnabled = false
        blur.translatesAutoresizingMaskIntoConstraints = false
        
        let background:UIImageView = UIImageView()
        background.isUserInteractionEnabled = false
        background.translatesAutoresizingMaskIntoConstraints = false
        background.clipsToBounds = true
        background.contentMode = UIViewContentMode.scaleAspectFill
        background.image = controller.image
        
        let imageView:UIImageView = UIImageView()
        imageView.isUserInteractionEnabled = false
        imageView.translatesAutoresizingMaskIntoConstraints = false
        imageView.clipsToBounds = true
        imageView.contentMode = UIViewContentMode.scaleAspectFit
        imageView.image = controller.image
        
        let bar:VHomeFilteredBar = VHomeFilteredBar(controller:controller)
        self.bar = bar
        
        addSubview(background)
        addSubview(blur)
        addSubview(imageView)
        
        let views:[String:UIView] = [
            "imageView":imageView,
            "blur":blur,
            "background":background]
        
        let metrics:[String:CGFloat] = [
            "barHeight":barHeight]
        
        addConstraints(NSLayoutConstraint.constraints(
            withVisualFormat:"H:|-0-[imageView]-0-|",
            options:[],
            metrics:metrics,
            views:views))
        addConstraints(NSLayoutConstraint.constraints(
            withVisualFormat:"V:|-(barHeight)-[imageView]-0-|",
            options:[],
            metrics:metrics,
            views:views))
        addConstraints(NSLayoutConstraint.constraints(
            withVisualFormat:"H:|-0-[blur]-0-|",
            options:[],
            metrics:metrics,
            views:views))
        addConstraints(NSLayoutConstraint.constraints(
            withVisualFormat:"V:|-(barHeight)-[blur]-0-|",
            options:[],
            metrics:metrics,
            views:views))
        addConstraints(NSLayoutConstraint.constraints(
            withVisualFormat:"H:|-0-[background]-0-|",
            options:[],
            metrics:metrics,
            views:views))
        addConstraints(NSLayoutConstraint.constraints(
            withVisualFormat:"V:|-(barHeight)-[background]-0-|",
            options:[],
            metrics:metrics,
            views:views))
        
        let controllerBar:VBar = controller.parentController.viewParent.bar
        controllerBar.addSubview(bar)
        
        let barViews:[String:UIView] = [
            "bar":bar]
        
        let barMetrics:[String:CGFloat] = [
            "barWidth":kBarWidth]
        
        controllerBar.addConstraints(NSLayoutConstraint.constraints(
            withVisualFormat:"H:[bar(barWidth)]-0-|",
            options:[],
            metrics:barMetrics,
            views:barViews))
        controllerBar.addConstraints(NSLayoutConstraint.constraints(
            withVisualFormat:"V:|-0-[bar]-0-|",
            options:[],
            metrics:barMetrics,
            views:barViews))
    }
    
    deinit
    {
        bar.removeFromSuperview()
    }
}
{'fraction_non_alphanumeric': 0.09185441941074524, 'fraction_numerical': 0.004159445407279029, 'mean_word_length': 2.2850094876660343, 'pattern_counts': {'":': 12, '<': 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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3824026', 'n_tokens_mistral': 2290, 'n_tokens_neox': 2250, 'n_words': 303}