<commit_before>var RippleAddress = require('../models/ripple_address');

module.exports = (function(){
  function show(req, res) {
    if (req.params.tag) {
      var where = { address: req.params.account, tag: req.params.tag }; 
    } else {
      var where = { address: req.params.account, tag: null }; 
    }
    RippleAddress.find({ where: where }).complete(function(err, address){
      if (err) {
        res.send(500, { error: err });
      } else {
        if (!user.admin) { address.secret = null };
        res.send({ ripple_address: address });
      }
    });
  };

  function create(req, res) {
    req.assert('address', 'Invalid address').notNull();

    if (!req.user.admin) {
      req.assert('user_id', 'Invalid user_id').isInt();
      userId = req.body.user_id;
    } else {<commit_msg>[FEATURE] Validate the type of a ripple_address<commit_after>var RippleAddress = require('../models/ripple_address');

module.exports = (function(){
  function show(req, res) {
    if (req.params.tag) {
      var where = { address: req.params.account, tag: req.params.tag }; 
    } else {
      var where = { address: req.params.account, tag: null }; 
    }
    RippleAddress.find({ where: where }).complete(function(err, address){
      if (err) {
        res.send(500, { error: err });
      } else {
        if (!user.admin) { address.secret = null };
        res.send({ ripple_address: address });
      }
    });
  };

  function create(req, res) {
    req.assert('address', 'Invalid address').notNull();
    req.assert('type', 'Invalid type.').isIn(['hot', 'cold', 'hosted', 'independent']);

    if (!req.user.admin) {
      req.assert('user_id', 'Invalid user_id').isInt();
      userId = req.body.user_id;
    } else {
{'fraction_non_alphanumeric': 0.17551963048498845, 'fraction_numerical': 0.003464203233256351, 'mean_word_length': 2.767391304347826, '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': '4104916', 'n_tokens_mistral': 573, 'n_tokens_neox': 552, 'n_words': 122}