<commit_before>var UserValidator = Ember.Object.create({
    check: function (model) {
        var validator = this.validators[model.get('status')];

        if (typeof validator !== 'function') {
            return [];
        }

        return validator(model);
    },

    validators: {
        invited: function (model) {
            var validationErrors = [],
                email = model.get('email'),
                roles = model.get('roles');

            if (!validator.isEmail(email)) {
                validationErrors.push({ message: '请输入有效的邮箱地址' });
            }

            if (roles.length < 1) {
                validationErrors.push({ message: '请为用户选择角色/权限' });
            }

            return validationErrors;
        },

        active: function (model) {
            var validationErrors = [],
                name = model.get('name'),
                bio = model.get('bio'),
                email = model.get('email'),
                location = model.get('location'),
                website = model.get('website');

            if (!validator.isLength(name, 0, 150)) {
                validationErrors.push({ message: '姓名太长' });
            }

            if (!validator.isLength(bio, 0, 200)) {
                validationErrors.push({ message: '个人简介太长' });
            }

            if (!validator.isEmail(email)) {
                validationErrors.push({ message: '请输入有效的邮箱地址' });
            }

            if (!validator.isLength(location, 0, 150)) {
                validationErrors.push({ message: '所在地太长' });
            }

            if (!Ember.isEmpty(website) &&
                (!validator.isURL(website, {protocols: ['http', 'https'], require_protocol: true}) ||
                !validator.isLength(website, 0, 2000))) {

                validationErrors.push({ message: '个人网站不是有效的网址' });<commit_msg>fix typo<commit_after>var UserValidator = Ember.Object.create({
    check: function (model) {
        var validator = this.validators[model.get('status')];

        if (typeof validator !== 'function') {
            return [];
        }

        return validator(model);
    },

    validators: {
        invited: function (model) {
            var validationErrors = [],
                email = model.get('email'),
                roles = model.get('roles');

            if (!validator.isEmail(email)) {
                validationErrors.push({ message: '请输入有效的邮箱地址' });
            }

            if (roles.length < 1) {
                validationErrors.push({ message: '请为用户选择角色/权限' });
            }

            return validationErrors;
        },

        active: function (model) {
            var validationErrors = [],
                name = model.get('name'),
                bio = model.get('bio'),
                email = model.get('email'),
                location = model.get('location'),
                website = model.get('website');

            if (!validator.isLength(name, 0, 150)) {
                validationErrors.push({ message: '姓名太长' });
            }

            if (!validator.isLength(bio, 0, 200)) {
                validationErrors.push({ message: '个人简介太长' });
            }

            if (!validator.isEmail(email)) {
                validationErrors.push({ message: '请输入有效的邮箱地址' });
            }

            if (!validator.isLength(location, 0, 150)) {
                validationErrors.push({ message: '所在地太长' });
            }

            if (!Ember.isEmpty(website) &&
                (!validator.isURL(website, {protocols: ['http', 'https'], require_protocol: true}) ||
                !validator.isLength(website, 0, 2000))) {
                validationErrors.push({ message: '个人网站不是有效的网址' });
{'fraction_non_alphanumeric': 0.14177077675176533, 'fraction_numerical': 0.00977729494839761, 'mean_word_length': 1.599153140437544, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '7366211', 'n_tokens_mistral': 1086, 'n_tokens_neox': 1056, 'n_words': 189}