<commit_before>//
//  CollapsibleCell.swift
//  Freetime
//
//  Created by <NAME> on 5/28/17.
//  Copyright © 2017 <NAME>. All rights reserved.
//

import UIKit

let CollapseCellMinHeight: CGFloat = 20

func CreateCollapsibleOverlay() -> CALayer {
    let layer = CAGradientLayer()
    layer.isHidden = true
    layer.colors = [
        UIColor(white: 1, alpha: 0).cgColor,
        UIColor(white: 0, alpha: 0.1).cgColor
    ]
    return layer
}

func LayoutCollapsible(layer: CALayer, view: UIView) {
    if layer.superlayer != view.layer {
        view.layer.addSublayer(layer)
    }

    let bounds = view.bounds
    layer.frame = CGRect(
        x: 0,
        y: bounds.height - CollapseCellMinHeight,
        width: bounds.width,
        height: CollapseCellMinHeight
    )
}

protocol CollapsibleCell {

    func setCollapse(visible: Bool)

}<commit_msg>disable collapse overlay animations<commit_after>//
//  CollapsibleCell.swift
//  Freetime
//
//  Created by <NAME> on 5/28/17.
//  Copyright © 2017 <NAME>. All rights reserved.
//

import UIKit

let CollapseCellMinHeight: CGFloat = 20

func CreateCollapsibleOverlay() -> CALayer {
    let layer = CAGradientLayer()
    layer.isHidden = true
    layer.colors = [
        UIColor(white: 1, alpha: 0).cgColor,
        UIColor(white: 0, alpha: 0.1).cgColor
    ]
    return layer
}

func LayoutCollapsible(layer: CALayer, view: UIView) {
    if layer.superlayer != view.layer {
        view.layer.addSublayer(layer)
    }

    let bounds = view.bounds

    // disable implicit CALayer animations
    CATransaction.begin()
    CATransaction.setValue(kCFBooleanTrue, forKey: kCATransactionDisableActions)
    layer.frame = CGRect(
        x: 0,
        y: bounds.height - CollapseCellMinHeight,
        width: bounds.width,
        height: CollapseCellMinHeight
    )
    CATransaction.commit()
}

protocol CollapsibleCell {

    func setCollapse(visible: Bool)

}
{'fraction_non_alphanumeric': 0.10792492179353493, 'fraction_numerical': 0.017726798748696558, 'mean_word_length': 2.7189922480620154, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '7382134', 'n_tokens_mistral': 670, 'n_tokens_neox': 618, 'n_words': 148}