<commit_before>//
//  StreamHeaderCell.swift
//  Ello
//
//  Created by <NAME> on 11/22/14.
//  Copyright (c) 2014 Ello. All rights reserved.
//

import UIKit
import Foundation



class StreamHeaderCell: UICollectionViewCell {

    @IBOutlet weak var avatarImageView: UIImageView!
    @IBOutlet weak var usernameLabel: UILabel!
    @IBOutlet weak var timestampLabel: UILabel!
    @IBOutlet weak var userNameLeadingConstraint: NSLayoutConstraint!

    var calculatedHeight:CGFloat = 80.0
    var streamKind:StreamKind?

    func setAvatarURL(url:NSURL) {

        avatarImageView.sd_setImageWithURL(url, completed: {
            (image, error, type, url) -> Void in

            if error == nil && image != nil {
                let size = self.avatarImageView.bounds.size
                self.avatarImageView.image = image.squareImageToSize(size)?.roundCorners()

                UIView.animateWithDuration(0.15, animations: {
                    self.contentView.alpha = 1.0
                })
            }
            else {
                self.avatarImageView.image = nil
            }
        })
    }
<commit_msg>cleanup<commit_after>//
//  StreamHeaderCell.swift
//  Ello
//
//  Created by <NAME> on 11/22/14.
//  Copyright (c) 2014 Ello. All rights reserved.
//

import UIKit
import Foundation



class StreamHeaderCell: UICollectionViewCell {

    @IBOutlet weak var avatarImageView: UIImageView!
    @IBOutlet weak var usernameLabel: UILabel!
    @IBOutlet weak var timestampLabel: UILabel!
    @IBOutlet weak var userNameLeadingConstraint: NSLayoutConstraint!

    var calculatedHeight:CGFloat = 80.0
    var streamKind:StreamKind?

    func setAvatarURL(url:NSURL) {

        avatarImageView.sd_setImageWithURL(url, completed: {
            (image, error, type, url) in

            if error == nil && image != nil {
                let size = self.avatarImageView.bounds.size
                self.avatarImageView.image = image.squareImageToSize(size)?.roundCorners()

                UIView.animateWithDuration(0.15, animations: {
                    self.contentView.alpha = 1.0
                })
            }
            else {
                self.avatarImageView.image = nil
            }
        })
    }

{'fraction_non_alphanumeric': 0.09254267744833783, 'fraction_numerical': 0.016172506738544475, 'mean_word_length': 2.1103351955307263, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, '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': '3394334', 'n_tokens_mistral': 700, 'n_tokens_neox': 632, 'n_words': 147}