def is_password_usable(pw):
    # like Django's is_password_usable, but only checks for unusable
    # passwords, not invalidly encoded passwords too.
    try:
        # 1.5
        from django.contrib.auth.hashers import UNUSABLE_PASSWORD
        return pw != UNUSABLE_PASSWORD
    except __HOLE__:
        # 1.6
        from django.contrib.auth.hashers import UNUSABLE_PASSWORD_PREFIX
        return not pw.startswith(UNUSABLE_PASSWORD_PREFIX)
dataset/ETHPy150Open fusionbox/django-authtools/authtools/forms.py/is_password_usable