def verify(self, password, encoded):
        algo_and_hash, key_ver = encoded.rsplit('$', 1)
        try:
            shared_key = settings.HMAC_KEYS[key_ver]
        except __HOLE__:
            log.info('Invalid shared key version "{0}"'.format(key_ver))
            # Fall back to normal bcrypt
            algorithm, data = encoded.split('$', 1)
            return constant_time_compare(data, bcrypt.hashpw(password, data))

        bc_value = '${0}'.format(algo_and_hash.split('$', 1)[1])  # Yes, bcrypt <3s the leading $.
        hmac_value = self._hmac_create(password, shared_key)
        return bcrypt.hashpw(hmac_value, bc_value) == bc_value
dataset/ETHPy150Open fwenzel/django-sha2/django_sha2/hashers.py/BcryptHMACCombinedPasswordVerifier.verify