Check to make sure password fields match.
428049
def clean(self):
        ''''''
        data = super(PasswordForm, self).clean()
        if 'new_password' in data:
            if data['new_password'] != data.get('confirm_password', None):
                raise ValidationError(_('Passwords do not match.'))
            if data.get('confirm_password', None) == \
                    data.get('current_password', None):
                raise ValidationError(_('Old password and new password '
                                        'must be different'))
        return data
549731
def check_password(self, raw_password):
        
        def setter(raw_password):
            self.set_password(raw_password)
            self.save(update_fields=[self.PASSWORD_FIELD])
        return check_password(raw_password, getattr(self, self.PASSWORD_FIELD), setter)
1263557
public function checkPassword(): bool
    {
        if (!isset($this->regex)) {
            return true;
        }

        return filter_var($this->password, FILTER_VALIDATE_REGEXP, [
            'options' => [
                'regexp' => $this->regex
            ]
        ]);
    }
1013633
def validate(record)
      if record.password_provider? or options[:force]
        if record.new_record? and record.password.to_s.blank? and !record.password_changed?
          record.errors.add :password, :blank
        elsif record.password_changed?
          if record.password.to_s.size < 4
            record.errors.add :password, :invalid_password
          elsif record.password.to_s != record.password_confirmation.to_s
            record.errors.add :password, :no_match_password
          end
        end
      end
    end
974364
def check_password(cls, instance, raw_password, enable_hash_migration=True):
        
        verified, replacement_hash = instance.passwordmanager.verify_and_update(
            raw_password, instance.user_password
        )
        if enable_hash_migration and replacement_hash:
            if six.PY2:
                instance.user_password = replacement_hash.decode("utf8")
            else:
                instance.user_password = replacement_hash
        return verified
585913
def is_valid_password(password):
    
    pattern = re.compile(r"^.{4,75}$")
    return bool(pattern.match(password))
721250
def clean_new_password2(self):
        """"""
        password1 = self.cleaned_data.get('new_password1')
        password2 = self.cleaned_data.get('new_password2')

        try:
            directory = APPLICATION.default_account_store_mapping.account_store
            directory.password_policy.strength.validate_password(password2)
        except ValueError as e:
            raise forms.ValidationError(str(e))

        if password1 and password2:
            if password1 != password2:
                raise forms.ValidationError("The two passwords didn't match.")

        return password2
213386
def is_valid(self):
        """"""
        form = super(AuthenticateForm, self).is_valid()
        for f, error in self.errors.items():
            if f != "__all__":
                self.fields[f].widget.attrs.update({"class": "error", "placeholder": ", ".join(list(error))})
            else:
                errors = list(error)
                if "This account is inactive." in errors:
                    message = "Intranet access restricted"
                else:
                    message = "Invalid password"
                self.fields["password"].widget.attrs.update({"class": "error", "placeholder": message})

        return form
797543
def check_key(key, allowed):
    

    if key in allowed:
        return True

    for pattern in allowed:
        if fnmatch(key, pattern):
            return True

    return False
498970
def clean_password(self):
        
        user_pass = self.cleaned_data.get('password')
        matches = Password.objects.filter(password=user_pass)
        if not matches:
            raise forms.ValidationError("Your password does not match.")
377381
protected function checkPasswords()
    {
        if($this->getOriginal('password') != $this->password){

            if($this->password === $this->password_confirmation){

                // Hashes password and unset password_confirmation field
                $this->password = bcrypt($this->password);

                unset($this->password_confirmation);

            } else {

                return false;
            }

        }

        return true;
    }
519550
private function checkIfAdminExists(): void
    {
        $adminExists = $this->userService->getRepository()->findOneBy(['email' => $this->email]);

        if (!is_null($adminExists)) {

            $this->checkIfHaveSuperAdminRole($adminExists);

            $this->info('Admin account already exists!');

            if ($this->confirm('Do you want to change its password? [y|N]')) {
                $this->changePassword($adminExists);
            }

            exit;
        }
    }
192134
public boolean check(Object credentials)
    {
	if (this == credentials)
	    return true;
	
        if (credentials instanceof Password)
            return credentials.equals(_pw);
        
        if (credentials instanceof String)
            return credentials.equals(_pw);
        
        if (credentials instanceof Credential)
            return ((Credential)credentials).check(_pw);
            
        return false;
    }
331421
def _check(delete, force, update, passwordfile, exclude, excludefrom, dryrun, rsh):
    '''
    
    '''
    options = ['-avz']

    if delete:
        options.append('--delete')
    if force:
        options.append('--force')
    if update:
        options.append('--update')
    if rsh:
        options.append('--rsh={0}'.format(rsh))
    if passwordfile:
        options.extend(['--password-file', passwordfile])
    if excludefrom:
        options.extend(['--exclude-from', excludefrom])
        if exclude:
            exclude = False
    if exclude:
        if isinstance(exclude, list):
            for ex_ in exclude:
                options.extend(['--exclude', ex_])
        else:
            options.extend(['--exclude', exclude])
    if dryrun:
        options.append('--dry-run')
    return options
493089
def check_credentials(self):
        
        if self.username is None or self.password is None:
            raise DistlibException('username and password must be set')
        pm = HTTPPasswordMgr()
        _, netloc, _, _, _, _ = urlparse(self.url)
        pm.add_password(self.realm, netloc, self.username, self.password)
        self.password_handler = HTTPBasicAuthHandler(pm)
761462
def check_credentials(self, username, password):
        
        return password is not None and self.credentials.get(username, None) == password
972245
def check_password(self, hashed_password, plain_password):
        
        salt, encrypted_password = hashed_password.split('$')
        re_encrypted_password = self.get_hash(salt, plain_password)
        return encrypted_password == re_encrypted_password