<commit_before>var status_classes = 'alert-error alert-success alert-info';

function autofocus(selector) {
    $(function () {
        $(selector)[0].focus();
    });
}

// Return a boolean indicating whether the password is acceptable.
// Also updates a Bootstrap progress bar control (a jQuery object)
// if provided.
//
// Assumes that zxcvbn.js has been loaded.
//
// This is in common.js because we want to use it from the signup page
// and also from the in-app password change interface.
function password_quality(password, bar) {
    // We load zxcvbn.js asynchronously, so the variable might not be set.
    if (typeof zxcvbn === 'undefined')
        return undefined;

    var result     = zxcvbn(password);
    var acceptable = result.crack_time >= 1e5;
    var quality;

    if (bar !== undefined) {
        // Compute a quality score in [0,1].
        quality = Math.min(1, Math.log(1 + result.crack_time) / 22);

        // Display the password quality score on a progress bar
        // which bottoms out at 10% so there's always something
        // for the user to see.
        bar.width(((90 * quality) + 10) + '%')
           .removeClass('bar-success bar-danger')
           .addClass(acceptable ? 'bar-success' : 'bar-danger');
    }

    return acceptable;
}
<commit_msg>Accept any password with at least 6 characters<commit_after>var status_classes = 'alert-error alert-success alert-info';

function autofocus(selector) {
    $(function () {
        $(selector)[0].focus();
    });
}

// Return a boolean indicating whether the password is acceptable.
// Also updates a Bootstrap progress bar control (a jQuery object)
// if provided.
//
// Assumes that zxcvbn.js has been loaded.
//
// This is in common.js because we want to use it from the signup page
// and also from the in-app password change interface.
function password_quality(password, bar) {
    // We load zxcvbn.js asynchronously, so the variable might not be set.
    if (typeof zxcvbn === 'undefined')
        return undefined;

    // Consider the password acceptable if it's at least 6 characters.
    var acceptable = password.length >= 6;

    if (bar !== undefined) {
        // Compute a quality score in [0,1].
        var result  = zxcvbn(password);
        var quality = Math.min(1, Math.log(1 + result.crack_time) / 22);

        // Even if zxcvbn loves your short password, the bar should be filled
        // at most 1/3 of the way, because we won't accept it.
        if (!acceptable)
            quality = Math.min(quality, 0.33);

        // Display the password quality score on a progress bar
        // which bottoms out at 10% so there's always something
        // for the user to see.
        bar.width(((90 * quality) + 10) + '%')
           .removeClass('bar-success bar-danger')
           .addClass(acceptable ? 'bar-success' : 'bar-danger');
    }

    return acceptable;
}

{'fraction_non_alphanumeric': 0.11211072664359861, 'fraction_numerical': 0.01245674740484429, 'mean_word_length': 2.534229828850856, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4121380', 'n_tokens_mistral': 845, 'n_tokens_neox': 799, 'n_words': 312}