<commit_before>//
//  GLSTableViewCell.swift
//  crazycells
//
//  Created by <NAME> on 7/11/15.
//  Copyright © 2015 ganglion software. All rights reserved.
//

import UIKit

enum GLSTableViewCellAnimationType:Int {
    case zoom
    case slideFromRight, slideFromLeft
    case cardShuffle
    case blinds
    case flipIn, flipInLeft, flipInRight
    
    static func random() -> GLSTableViewCellAnimationType {
        let max = flipInRight.rawValue
        return GLSTableViewCellAnimationType(rawValue:Int(arc4random_uniform(UInt32(max + 1))))!
    }
}

class GLSTableViewCell: UITableViewCell {
    var animationType:GLSTableViewCellAnimationType = GLSTableViewCellAnimationType.flipIn
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)
        // Configure the view for the selected state
    }
    
    func zoomAnimation(_ duration:TimeInterval)
    {
        self.contentView.layer.transform = CATransform3DMakeScale(0.001, 0.001, 1.0)
        let oldColor:UIColor? = self.contentView.backgroundColor
        weak var weakSelf = self
        UIView.animate(withDuration: duration, delay: 0, options: UIViewAnimationOptions(), animations: { () -> Void in
            weakSelf?.contentView.layer.transform = CATransform3DIdentity
            weakSelf?.contentView.backgroundColor = oldColor
            }, completion: nil)
    }
    
    func slideAnimation(_ startX:CGFloat, duration:TimeInterval)
    {
        weak var weakSelf = self
        self.contentView.layer.transform = CATransform3DMakeTranslation(startX, 0, 0);
        UIView.animate(withDuration: duration, delay: 0, options: UIViewAnimationOptions(), animations: { () -> Void in
            weakSelf?.contentView.layer.transform = CATransform3DIdentity
            }, completion: nil)
    }
    
    func animateFromTransform(_ transform:CATransform3D, duration:TimeInterval)
    {
        weak var weakSelf = self
        let oldColor:UIColor? = self.contentView.backgroundColor
        self.contentView.backgroundColor = UIColor.gray
        self.contentView.layer.transform = transform
        UIView.animate(withDuration: duration, delay: 0, options: UIViewAnimationOptions(), animations: { () -> Void in
            weakSelf?.contentView.layer.transform = CATransform3DIdentity
            weakSelf?.contentView.backgroundColor = oldColor
            }, completion: nil)
    }
    
    func shuffleTransform(_ z:CGFloat, scale:CGFloat) -> CATransform3D
    {
        var transform:CATransform3D = CATransform3DIdentity;
        transform.m34 = 1.0 / z;
        transform = CATransform3DScale(transform, scale, scale, scale)
        transform = CATransform3DTranslate(transform, 0.0, (-self.contentView.frame.size.height)/2, 0.0)
        transform = CATransform3DRotate(transform, CGFloat(M_PI/2.0), 1.0, 0.0, 0.0)
        transform = CATransform3DTranslate(transform, 0.0, (self.contentView.frame.size.height)/2, 0.0)
        return transform
    }
    
    func flipInTransform() -> CATransform3D
    {
        var transform:CATransform3D = CATransform3DIdentity;
        transform.m34 = 1.0 / -600;
        transform = CATransform3DRotate(transform, CGFloat(M_PI/2.0), 0.0, 1.0, 0.0)
        return transform
    }
    
    func flipInLeftTransform() -> CATransform3D
    {
        var transform:CATransform3D = CATransform3DIdentity;
        transform.m34 = 1.0 / -600;
        transform = CATransform3DTranslate(transform, (-self.contentView.frame.size.width)/2, 0.0, 0.0)
        transform = CATransform3DRotate(transform, CGFloat(M_PI/2.0), 0.0, 1.0, 0.0)
        transform = CATransform3DTranslate(transform, (self.contentView.frame.size.width)/2, 0.0, 0.0)
        return transform
    }
    
    func flipInRightTransform() -> CATransform3D
    {
        var transform:CATransform3D = CATransform3DIdentity;
        transform.m34 = 1.0 / -600;
        transform = CATransform3DTranslate(transform, (self.contentView.frame.size.width)/2, 0.0, 0.0)
        transform = CATransform3DRotate(transform, CGFloat(M_PI/2.0), 0.0, 1.0, 0.0)
        transform = CATransform3DTranslate(transform, (-self.contentView.frame.size.width)/2, 0.0, 0.0)
        return transform
    }
    <commit_msg>Removed M_PI references<commit_after>//
//  GLSTableViewCell.swift
//  crazycells
//
//  Created by <NAME> on 7/11/15.
//  Copyright © 2015 ganglion software. All rights reserved.
//

import UIKit

enum GLSTableViewCellAnimationType:Int {
    case zoom
    case slideFromRight, slideFromLeft
    case cardShuffle
    case blinds
    case flipIn, flipInLeft, flipInRight
    
    static func random() -> GLSTableViewCellAnimationType {
        let max = flipInRight.rawValue
        return GLSTableViewCellAnimationType(rawValue:Int(arc4random_uniform(UInt32(max + 1))))!
    }
}

class GLSTableViewCell: UITableViewCell {
    var animationType:GLSTableViewCellAnimationType = GLSTableViewCellAnimationType.flipIn
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)
        // Configure the view for the selected state
    }
    
    func zoomAnimation(_ duration:TimeInterval)
    {
        self.contentView.layer.transform = CATransform3DMakeScale(0.001, 0.001, 1.0)
        let oldColor:UIColor? = self.contentView.backgroundColor
        weak var weakSelf = self
        UIView.animate(withDuration: duration, delay: 0, options: UIViewAnimationOptions(), animations: { () -> Void in
            weakSelf?.contentView.layer.transform = CATransform3DIdentity
            weakSelf?.contentView.backgroundColor = oldColor
            }, completion: nil)
    }
    
    func slideAnimation(_ startX:CGFloat, duration:TimeInterval)
    {
        weak var weakSelf = self
        self.contentView.layer.transform = CATransform3DMakeTranslation(startX, 0, 0);
        UIView.animate(withDuration: duration, delay: 0, options: UIViewAnimationOptions(), animations: { () -> Void in
            weakSelf?.contentView.layer.transform = CATransform3DIdentity
            }, completion: nil)
    }
    
    func animateFromTransform(_ transform:CATransform3D, duration:TimeInterval)
    {
        weak var weakSelf = self
        let oldColor:UIColor? = self.contentView.backgroundColor
        self.contentView.backgroundColor = UIColor.gray
        self.contentView.layer.transform = transform
        UIView.animate(withDuration: duration, delay: 0, options: UIViewAnimationOptions(), animations: { () -> Void in
            weakSelf?.contentView.layer.transform = CATransform3DIdentity
            weakSelf?.contentView.backgroundColor = oldColor
            }, completion: nil)
    }
    
    func shuffleTransform(_ z:CGFloat, scale:CGFloat) -> CATransform3D
    {
        var transform:CATransform3D = CATransform3DIdentity;
        transform.m34 = 1.0 / z;
        transform = CATransform3DScale(transform, scale, scale, scale)
        transform = CATransform3DTranslate(transform, 0.0, (-self.contentView.frame.size.height)/2, 0.0)
        transform = CATransform3DRotate(transform, CGFloat(Double.pi/2.0), 1.0, 0.0, 0.0)
        transform = CATransform3DTranslate(transform, 0.0, (self.contentView.frame.size.height)/2, 0.0)
        return transform
    }
    
    func flipInTransform() -> CATransform3D
    {
        var transform:CATransform3D = CATransform3DIdentity;
        transform.m34 = 1.0 / -600;
        transform = CATransform3DRotate(transform, CGFloat(Double.pi/2.0), 0.0, 1.0, 0.0)
        return transform
    }
    
    func flipInLeftTransform() -> CATransform3D
    {
        var transform:CATransform3D = CATransform3DIdentity;
        transform.m34 = 1.0 / -600;
        transform = CATransform3DTranslate(transform, (-self.contentView.frame.size.width)/2, 0.0, 0.0)
        transform = CATransform3DRotate(transform, CGFloat(Double.pi/2.0), 0.0, 1.0, 0.0)
        transform = CATransform3DTranslate(transform, (self.contentView.frame.size.width)/2, 0.0, 0.0)
        return transform
    }
    
    func flipInRightTransform() -> CATransform3D
    {
        var transform:CATransform3D = CATransform3DIdentity;
        transform.m34 = 1.0 / -600;
        transform = CATransform3DTranslate(transform, (self.contentView.frame.size.width)/2, 0.0, 0.0)
        transform = CATransform3DRotate(transform, CGFloat(Double.pi/2.0), 0.0, 1.0, 0.0)
        transform = CATransform3DTranslate(transform, (-self.contentView.frame.size.width)/2, 0.0, 0.0)
        return transform
    }
    
{'fraction_non_alphanumeric': 0.10107724043089618, 'fraction_numerical': 0.03300481320192528, 'mean_word_length': 2.908195253022839, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, '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': '3201922', 'n_tokens_mistral': 2914, 'n_tokens_neox': 2637, 'n_words': 524}