<commit_before>// Instantiates the services and helpers.
var client = require('../helpers/client-helper').getClient();

var getUsers = function(callback) {
    var query = 'select * from Users';

    client.query(query, function(error, result) {
        if (!error) {
            var users = [];

            for (key in result) {
                users.push(result[key]);
            }
        }

        callback(error, users);
    });
};

var getUser = function(callback, email) {
    var query = 'select * from Users where Email ="' + email + '"';

    client.query(query, function(error, result) {
        if (!error) {
            var user = result[0];
        }

        callback(error, user);
    });
};

var createUser = function(callback, user) {
    var query = 'insert into Users (Username, Email, Password) VALUES('
        + '"' + user.username + '", "' + user.email + '", "' + user.password + '")';

    client.query(query, function(error, result) {
        callback(error);
    });
};

var login = function(callback, email, password) {
    var query = 'select * from Users where Email ="' + email + '" and Password = "' + password + '"';

    client.query(query, function(error, result) {
        if (!error) {
            var user = result[0];
        }

        callback(error, user);
    });
};

var logout = function(callback, token) {
    callback(null);
};<commit_msg>Removed a leftover username<commit_after>// Instantiates the services and helpers.
var client = require('../helpers/client-helper').getClient();

var getUsers = function(callback) {
    var query = 'select * from Users';

    client.query(query, function(error, result) {
        if (!error) {
            var users = [];

            for (key in result) {
                users.push(result[key]);
            }
        }

        callback(error, users);
    });
};

var getUser = function(callback, email) {
    var query = 'select * from Users where Email ="' + email + '"';

    client.query(query, function(error, result) {
        if (!error) {
            var user = result[0];
        }

        callback(error, user);
    });
};

var createUser = function(callback, user) {
    var query = 'insert into Users (Email, Password) VALUES('
        + '"' + user.email + '", "' + user.password + '")';

    client.query(query, function(error, result) {
        callback(error);
    });
};

var login = function(callback, email, password) {
    var query = 'select * from Users where Email ="' + email + '" and Password = "' + password + '"';

    client.query(query, function(error, result) {
        if (!error) {
            var user = result[0];
        }

        callback(error, user);
    });
};

var logout = function(callback, token) {
    callback(null);
};
{'fraction_non_alphanumeric': 0.15778019586507072, 'fraction_numerical': 0.0014508523757707653, 'mean_word_length': 2.310924369747899, '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': '4012249', 'n_tokens_mistral': 818, 'n_tokens_neox': 787, 'n_words': 209}