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

import UIKit

public extension String {

    func isValidEmail() -> Bool {
        let emailRegEx = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,20}"
        let emailTest = NSPredicate(format:"SELF MATCHES %@", emailRegEx)
        let result = emailTest?.evaluateWithObject(self)
        return result ?? false
    }

    func isValidPassword() -> Bool {
        return countElements(self) > 0
    }

}<commit_msg>passwords must be at least 8 characters long<commit_after>//
//  Validator.swift
//  Ello
//
//  Created by <NAME> on 11/25/14.
//  Copyright (c) 2014 Ello. All rights reserved.
//

import UIKit

public extension String {

    func isValidEmail() -> Bool {
        let emailRegEx = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,20}"
        let emailTest = NSPredicate(format:"SELF MATCHES %@", emailRegEx)
        let result = emailTest?.evaluateWithObject(self)
        return result ?? false
    }

    func isValidPassword() -> Bool {
        return countElements(self) >= 8
    }

}
{'fraction_non_alphanumeric': 0.16171328671328672, 'fraction_numerical': 0.032342657342657344, 'mean_word_length': 2.3875739644970415, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '501229', 'n_tokens_mistral': 440, 'n_tokens_neox': 397, 'n_words': 93}