<commit_before>//
//  LoginViewNative.swift
//  LoginStevia
//
//  Created by <NAME> on 01/10/15.
//  Copyright © 2015 <NAME>. All rights reserved.
//

import UIKit

class LoginViewNative:UIView {
    
    let email = UITextField()
    let password = UITextField()
    let login = UIButton()
    
    convenience init() {
        self.init(frame:CGRectZero)
        backgroundColor = .whiteColor()
    
        addSubview(email)
        addSubview(password)
        addSubview(login)
        
        email.translatesAutoresizingMaskIntoConstraints = false
        password.translatesAutoresizingMaskIntoConstraints = false
        login.translatesAutoresizingMaskIntoConstraints = false
        
        addConstraint(NSLayoutConstraint(
                item: email,
                attribute: .Left,
                relatedBy: .Equal,
                toItem: self,
                attribute: .Left,
                multiplier: 1,
                constant: 8)
        )
        addConstraint(NSLayoutConstraint(
                item: email,
                attribute: .Right,
                relatedBy: .Equal,
                toItem: self,
                attribute: .Right,
                multiplier: 1,
                constant: -8)
        )
        addConstraint(NSLayoutConstraint(
            item: password,
            attribute: .Left,
                relatedBy: .Equal,
                toItem: self,
                attribute: .Left,
                multiplier: 1,
                constant: 8)
        )
        addConstraint(NSLayoutConstraint(
            item: password,
            attribute: .Right,
            relatedBy: .Equal,
            toItem: self,
            attribute: .Right,
            multiplier: 1,
            constant: -8)
        )
        addConstraint(NSLayoutConstraint(
            item: login,
            attribute: .Left,
            relatedBy: .Equal,
            toItem: self,
            attribute: .Left,
            multiplier: 1,
            constant: 0)
        )
        addConstraint(NSLayoutConstraint(
            item: login,
            attribute: .Right,
            relatedBy: .Equal,
            toItem: self,
            attribute: .Right,
            multiplier: 1,
            constant: 0)
        )
        for b in [email, password, login] {
            addConstraint(NSLayoutConstraint(
                item: b,
                attribute: .Height,
                relatedBy: .Equal,
                toItem: nil,
                attribute: .NotAnAttribute,
                multiplier: 1,
                constant: 80)
            )
        }
        addConstraint(NSLayoutConstraint(
            item: email,
            attribute: .Top,
            relatedBy: .Equal,
            toItem: self,
            attribute: .Top,
            multiplier: 1,
            constant: 100)
        )
        addConstraint(NSLayoutConstraint(
            item:email,
            attribute: .Bottom,
            relatedBy: .Equal,
            toItem: password,
            attribute: .Top,
            multiplier: 1,
            constant: -8)
        )
        addConstraint(NSLayoutConstraint(
            item: login,
            attribute: .Bottom,
            relatedBy: .Equal,
            toItem: self,
            attribute: .Bottom,
            multiplier: 1,
            constant: 0)
        )
        
        email.placeholder = "Email"
        email.borderStyle = .RoundedRect
        email.autocorrectionType = .No
        email.keyboardType = .EmailAddress
        email.font = UIFont(name: "HelveticaNeue-Light", size: 26)
        email.returnKeyType = .Next
        
        password.placeholder = "Password"
        password.borderStyle = .RoundedRect
        password.font = UIFont(name: "HelveticaNeue-Light", size: 26)
        password.secureTextEntry = true
        password.returnKeyType = .Done
        
        login.setTitle("Login", forState: .Normal)
        login.backgroundColor = .lightGrayColor()
        login.addTarget(self, action: "loginTapped", forControlEvents: .TouchUpInside)
        login.setTitle(NSLocalizedString("Login", comment: ""), forState: .Normal)
    }
    
    func loginTapped() {
        //Do something
    }
}<commit_msg>Comments out NativeLayout for codeBeat<commit_after>////
////  LoginViewNative.swift
////  LoginStevia
////
////  Created by <NAME> on 01/10/15.
////  Copyright © 2015 <NAME>. All rights reserved.
////
//
//import UIKit
//
//class LoginViewNative:UIView {
//    
//    let email = UITextField()
//    let password = UITextField()
//    let login = UIButton()
//    
//    convenience init() {
//        self.init(frame:CGRectZero)
//        backgroundColor = .whiteColor()
//    
//        addSubview(email)
//        addSubview(password)
//        addSubview(login)
//        
//        email.translatesAutoresizingMaskIntoConstraints = false
//        password.translatesAutoresizingMaskIntoConstraints = false
//        login.translatesAutoresizingMaskIntoConstraints = false
//        
//        addConstraint(NSLayoutConstraint(
//                item: email,
//                attribute: .Left,
//                relatedBy: .Equal,
//                toItem: self,
//                attribute: .Left,
//                multiplier: 1,
//                constant: 8)
//        )
//        addConstraint(NSLayoutConstraint(
//                item: email,
//                attribute: .Right,
//                relatedBy: .Equal,
//                toItem: self,
//                attribute: .Right,
//                multiplier: 1,
//                constant: -8)
//        )
//        addConstraint(NSLayoutConstraint(
//            item: password,
//            attribute: .Left,
//                relatedBy: .Equal,
//                toItem: self,
//                attribute: .Left,
//                multiplier: 1,
//                constant: 8)
//        )
//        addConstraint(NSLayoutConstraint(
//            item: password,
//            attribute: .Right,
//            relatedBy: .Equal,
//            toItem: self,
//            attribute: .Right,
//            multiplier: 1,
//            constant: -8)
//        )
//        addConstraint(NSLayoutConstraint(
//            item: login,
//            attribute: .Left,
//            relatedBy: .Equal,
//            toItem: self,
//            attribute: .Left,
//            multiplier: 1,
//            constant: 0)
//        )
//        addConstraint(NSLayoutConstraint(
//            item: login,
//            attribute: .Right,
//            relatedBy: .Equal,
//            toItem: self,
//            attribute: .Right,
//            multiplier: 1,
//            constant: 0)
//        )
//        for b in [email, password, login] {
//            addConstraint(NSLayoutConstraint(
//                item: b,
//                attribute: .Height,
//                relatedBy: .Equal,
//                toItem: nil,
//                attribute: .NotAnAttribute,
//                multiplier: 1,
//                constant: 80)
//            )
//        }
//        addConstraint(NSLayoutConstraint(
//            item: email,
//            attribute: .Top,
//            relatedBy: .Equal,
//            toItem: self,
//            attribute: .Top,
//            multiplier: 1,
//            constant: 100)
//        )
//        addConstraint(NSLayoutConstraint(
//            item:email,
//            attribute: .Bottom,
//            relatedBy: .Equal,
//            toItem: password,
//            attribute: .Top,
//            multiplier: 1,
//            constant: -8)
//        )
//        addConstraint(NSLayoutConstraint(
//            item: login,
//            attribute: .Bottom,
//            relatedBy: .Equal,
//            toItem: self,
//            attribute: .Bottom,
//            multiplier: 1,
//            constant: 0)
//        )
//        
//        email.placeholder = "Email"
//        email.borderStyle = .RoundedRect
//        email.autocorrectionType = .No
//        email.keyboardType = .EmailAddress
//        email.font = UIFont(name: "HelveticaNeue-Light", size: 26)
//        email.returnKeyType = .Next
//        
//        password.placeholder = "Password"
//        password.borderStyle = .RoundedRect
//        password.font = UIFont(name: "HelveticaNeue-Light", size: 26)
//        password.secureTextEntry = true
//        password.returnKeyType = .Done
//        
//        login.setTitle("Login", forState: .Normal)
//        login.backgroundColor = .lightGrayColor()
//        login.addTarget(self, action: "loginTapped", forControlEvents: .TouchUpInside)
//        login.setTitle(NSLocalizedString("Login", comment: ""), forState: .Normal)
//    }
//    
//    func loginTapped() {
//        //Do something
//    }
//}
{'fraction_non_alphanumeric': 0.11588912969088627, 'fraction_numerical': 0.008440743697958253, 'mean_word_length': 1.2615424297136961, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '1365663', 'n_tokens_mistral': 2406, 'n_tokens_neox': 2300, 'n_words': 490}