<commit_before>var redisClient   = require('../redis_client/redisClient').getClient()
var configuration = require('../config/configuration.json')

module.exports = {
  changePasswordByUsername: function(username, password, callback) {
    var userTable = configuration.TableMSAccountModelUsername + username
		redisClient.get(userTable, function (err, replies) {
    	if (err)
				callback(err, null)
      if (replies === 'null')
        callback(null, configuration.message.login.notExistsUser)
      else
        this.passwordChange(replies, oldPassword, newPassword,function(err, replies) {
          if (err)
            callback(err, null)
          callback(null, replies)
        })
		})
  },

  changePasswordByEmail: function(email, password, callback) {
    var emailTable = configuration.TableMSAccountModelEmail + email
		redisClient.get(emailTable, function (err, replies) {
    	if (err)
				callback(err, null)
			if (replies === 'null')
        callback(null, configuration.message.login.notExistsUser)
      else
        this.passwordChange(replies, oldPassword, newPassword,function(err, replies) {
          if (err)
            callback(err, null)
          callback(null, replies)
        })
		})
  },

  passwordChange: function(accountHashID, oldPassword, newPassword, callback) {
    var modelTable = configuration.TableMAAccountModel + accountHashID
    redisClient.hget(modelTable, configuration.ConstantAMPassword, function(err, replies) {
      if (err)
        callback(err, null)
      if (replies === oldPassword)
      {
        redisClient.hset(modelTable, configuration.ConstantAMPassword, function(err, replies) {
          if (err)
            callback(err, null)
          callback(null, configuration.message.changePassword.successfulChange)
        })
      }
      else
        callback(null, configuration.message.changePassword.successfulChange)
    }
  },
}
<commit_msg>Modify And Add Starter Function<commit_after>var redisClient   = require('../redis_client/redisClient').getClient()
var configuration = require('../config/configuration.json')
var userChecker = require('./userChcker')
module.exports = {
  startPasswordChanging: function(accountModelObject, callback) {
    var accountHashID
    if (accountModelObject.option === 'username')
    {
      userChecker.checkUserExistenceByUsername(accountModel.user, function (err, replies) {
        if (err)
          callback(err, null)
        accountHashID = replies
      }
    }
    else if (accountModelObject.option === 'email')
    {
      userChecker.checkUserExistenceByEmail(accountModel.user, function (err, replies) {
        if (err)
          callback(err, null)
        accountHashID = replies
      }
    }
    var modelTable = configuration.TableMAAccountModel + accountHashID
    redisClient.hget(modelTable, configuration.ConstantAMPassword, function(err, replies) {
      if (err)
        callback(err, null)
      if (replies === accountModelObject.password)
        passwordChange(accountHashID, accountModelObject.newPassword, function(err, callback) {
          if (err)
            callback(err, null)
          callback(null, 'password succesfully changed message')
      })
    }
  }
  passwordChange: function(accountHashID, Password, callback) {
    var modelTable = configuration.TableMAAccountModel + accountHashID
    redisClient.hset(modelTable, configuration.ConstantAMPassword, function(err, replies) {
      if (err)
        callback(err, null)
    })
  }
}

{'fraction_non_alphanumeric': 0.10512747063878544, 'fraction_numerical': 0.0, 'mean_word_length': 3.2021660649819497, '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': '1770929', 'n_tokens_mistral': 984, 'n_tokens_neox': 967, 'n_words': 194}