def validate(self, password, user=None):
user_inputs = []<EOL>if user is not None:<EOL><INDENT>for attribute in self.user_attributes:<EOL><INDENT>if hasattr(user, attribute):<EOL><INDENT>user_inputs.append(getattr(user, attribute))<EOL><DEDENT><DEDENT><DEDENT>results = zxcvbn(password, user_inputs=user_inputs)<EOL>if results.get('<STR_LIT>', <NUM_LIT:0>) < self.min_score:<EOL><INDENT>feedback = '<STR_LIT:U+002CU+0020>'.join(<EOL>results.get('<STR_LIT>', {}).get('<STR_LIT>', []))<EOL>raise ValidationError(_(feedback), code=self.code, params={})<EOL><DEDENT>
Validate method, run zxcvbn and check score.