<commit_before>var redisClient = require('../libs/redis-client').redisClient;

var models = require('../models');

var user = new models.User();
user.login = process.argv[2];
user.password = process.argv[3];
user.email = process.argv[4];
user.isActive = true;
user.isSuperuser = true;
user.isStaff = true;


user.save(function(err, obj) {
	if(err === null) {
		console.log(obj.serialize(['id', 'login', 'email', 'isActive', 'isSuperuser', 'isStaff']))
	} else {
		
		if( err instanceof models.errors.ObjectAlreadyExists) {
			console.log('ObjectAlreadyExists');

		} else if( err instanceof models.errors.ValidationError) {
			console.log( obj.validationErrors);

		} else {
			console.log( 'Internal error')
		}
	}
	
	redisClient.end();
	
});
<commit_msg>tools to create consumer/token<commit_after>var redisClient = require('../libs/redis-client').redisClient;

var models = require('../models');

var user = new models.User();
user.login = process.argv[2];
user.password = <PASSWORD>[3];
user.email = process.argv[4];
user.isActive = true;
user.isSuperuser = true;
user.isStaff = true;


user.save(function(err, obj) {
	if(err === null) {
		console.log(obj.serialize(['id', 'login', 'email', 'isActive', 'isSuperuser', 'isStaff']))
		console.log('id: ' + obj.id);
		console.log('login: ' + obj.login);
		console.log('password: ' + obj.password);
		console.log('email: ' + obj.email);
		console.log('isSuperuser: ' + obj.isSuperuser);
		console.log('isStaff: ' + obj.isStaff);
		
	} else {
		
		if( err instanceof models.errors.ObjectAlreadyExists) {
			console.log('ObjectAlreadyExists');

		} else if( err instanceof models.errors.ValidationError) {
			console.log( obj.validationErrors);

		} else {
			console.log( 'Internal error')
		}
	}
	
	redisClient.end();
	
});

{'fraction_non_alphanumeric': 0.18151071025930102, 'fraction_numerical': 0.0033821871476888386, 'mean_word_length': 4.33033033033033, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '4978039', 'n_tokens_mistral': 654, 'n_tokens_neox': 592, 'n_words': 115}