<commit_before>import logging

logger = logging.getLogger(__name__)

try:
    from flaskext.bcrypt import Bcrypt, generate_password_hash

except ImportError:
    logger.warning("Bcrypt not available... falling back to SHA512.")

    import hashlib

    def generate_password_hash(password):
        return hashlib.sha512(password).hexdigest()

    def check_password_hash(reference, check):
        check_hash = hashlib.sha512(check).hexdigest()
        return check_hash == reference

    class SHA512Fallback(object):
        def __init__(self, app=None):
            self.generate_password_hash = generate_password_hash
            self.check_password_hash = check_password_hash

    Bcrypt = SHA512Fallback
<commit_msg>Better warning message about `bcrypt`.<commit_after>import logging

logger = logging.getLogger(__name__)

try:
    from flaskext.bcrypt import Bcrypt, generate_password_hash

except ImportError:
    logger.warning("Bcrypt not available... falling back to SHA512.")
    logger.warning("Run `pip install Flask-Bcrypt` for more secure password hashing.")

    import hashlib

    def generate_password_hash(password):
        return hashlib.sha512(password).hexdigest()

    def check_password_hash(reference, check):
        check_hash = hashlib.sha512(check).hexdigest()
        return check_hash == reference

    class SHA512Fallback(object):
        def __init__(self, app=None):
            self.generate_password_hash = generate_password_hash
            self.check_password_hash = check_password_hash

    Bcrypt = SHA512Fallback

{'fraction_non_alphanumeric': 0.07830551989730423, 'fraction_numerical': 0.019255455712451863, 'mean_word_length': 3.6957831325301207, 'pattern_counts': {'":': 0, '<': 3, '<?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': '324383', 'n_tokens_mistral': 468, 'n_tokens_neox': 424, 'n_words': 101}