<commit_before>var EtherCredClient = {
    getUser: function(userAddress, weightingAlgorithm, server) {
        return buildGraph(server.getApprovalsFor, server.getDisapprovalsFor, userAddress).then(function(graph) {
            return new EtherCredUser(userAddress, weightingAlgorithm, server, graph);
        });
    }
};

function EtherCredUser(userAddress, weightingAlgorithm, server, graph) {
    var client = this;

    this.userAddress = userAddress;
    this.weightingAlgorithm = weightingAlgorithm;
    this.server = server;
    this.graph = graph;

    this.getCredFor = function(addressOfUserToEvaluate) {
        return getCred(this.graph, this.userAddress, addressOfUserToEvaluate, this.weightingAlgorithm);
    };
}

function buildGraph(getApprovalsFor, getDisapprovalsFor, userId) {
    var graph = {};

    function register(userId, approvals, disapprovals) {
        if(!isRegistered(userId)) {
            graph[userId] = {approvals, disapprovals};
        }
    }

    function isRegistered(userId) {
        return graph[userId] ? true : false;
    }

    function executeQueue(queue) {
        if(queue.length) {
            var nextUser = queue.shift();
            return help(nextUser).then(function() {<commit_msg>Implements approve, unnaprove, disapprove, and undisapprove methods on EtherCredUser prototype<commit_after>var EtherCredClient = {
    getUser: function(userAddress, weightingAlgorithm, server) {
        return buildGraph(server.getApprovalsFor, server.getDisapprovalsFor, userAddress).then(function(graph) {
            return new EtherCredUser(userAddress, weightingAlgorithm, server, graph);
        });
    }
};

function EtherCredUser(userAddress, weightingAlgorithm, server, graph) {
    var client = this;

    this.userAddress = userAddress;
    this.weightingAlgorithm = weightingAlgorithm;
    this.server = server;
    this.graph = graph;

    this.approve = function(targetAddress) {
        return server.approve(this.userAddress, targetAddress);
    };

    this.unapprove = function(targetAddress) {
        return server.unapprove(this.userAddress, targetAddress);
    };

    this.disapprove = function(targetAddress) {
        return server.disapprove(this.userAddress, targetAddress);
    };

    this.undisapprove = function(targetAddress) {
        return server.undisapprove(this.userAddress, targetAddress);
    };

    this.getCredFor = function(addressOfUserToEvaluate) {
        return getCred(this.graph, this.userAddress, addressOfUserToEvaluate, this.weightingAlgorithm);
    };
}

function buildGraph(getApprovalsFor, getDisapprovalsFor, userId) {
    var graph = {};

    function register(userId, approvals, disapprovals) {
        if(!isRegistered(userId)) {
            graph[userId] = {approvals, disapprovals};
        }
    }

    function isRegistered(userId) {
        return graph[userId] ? true : false;
    }

    function executeQueue(queue) {
        if(queue.length) {
            var nextUser = queue.shift();
            return help(nextUser).then(function() {
{'fraction_non_alphanumeric': 0.10206760748276994, 'fraction_numerical': 0.0, 'mean_word_length': 3.417391304347826, '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': '5919502', 'n_tokens_mistral': 873, 'n_tokens_neox': 838, 'n_words': 163}