<commit_before>(function (Module) {
    'use strict';

    var async     = require('async'),
        fse       = require('fs-extra'),
        path      = require('path'),

        nodebb    = require('./nodebb'),
        sockets   = nodebb.pluginSockets,
        nconf     = nodebb.nconf,
        user      = nodebb.user,
        settings  = require('./settings'),
        database  = require('./database'),
        constants = require('./constants'),
        uploads   = require('./uploads');

    Module.init = function (callback) {
        sockets[constants.SOCKETS] = {};
        //Acknowledgements
        sockets[constants.SOCKETS].awardUsers = Module.awardUsers;
        sockets[constants.SOCKETS].createAward = Module.createAward;
        sockets[constants.SOCKETS].deleteAward = Module.deleteAward;
        sockets[constants.SOCKETS].getAwards = Module.getAwards;
        sockets[constants.SOCKETS].searchUser = Module.searchUser;

        callback();
    };

    /**
     * Grant Award for multiple users.
     * Registers: reason of the award, date, relationships
     *
     * @param socket Socket.io open connection
     * @param payload {object} Includes 'users', 'award' and 'reason' fields, where award is Award Id
     * @param callback
     */
    Module.awardUsers = function (socket, payload, callback) {
        async.each(payload.users, function (user, next) {
            database.createGrant(user.uid, payload.award, payload.reason, socket.uid, next);
            //TODO Add Notifications
        }, callback);
    };

    /**
     * Create a new Award<commit_msg>Award identifiers as integers<commit_after>(function (Module) {
    'use strict';

    var async     = require('async'),
        fse       = require('fs-extra'),
        path      = require('path'),

        nodebb    = require('./nodebb'),
        sockets   = nodebb.pluginSockets,
        nconf     = nodebb.nconf,
        user      = nodebb.user,
        settings  = require('./settings'),
        database  = require('./database'),
        constants = require('./constants'),
        uploads   = require('./uploads');

    Module.init = function (callback) {
        sockets[constants.SOCKETS] = {};
        //Acknowledgements
        sockets[constants.SOCKETS].awardUsers = Module.awardUsers;
        sockets[constants.SOCKETS].createAward = Module.createAward;
        sockets[constants.SOCKETS].deleteAward = Module.deleteAward;
        sockets[constants.SOCKETS].getAwards = Module.getAwards;
        sockets[constants.SOCKETS].searchUser = Module.searchUser;

        callback();
    };

    /**
     * Grant Award for multiple users.
     * Registers: reason of the award, date, relationships
     *
     * @param socket Socket.io open connection
     * @param payload {object} Includes 'users', 'award' and 'reason' fields, where award is Award Id
     * @param callback
     */
    Module.awardUsers = function (socket, payload, callback) {
        async.each(payload.users, function (user, next) {
            database.createGrant(user.uid, parseInt(payload.award, 10), payload.reason, socket.uid, next);
            //TODO Add Notifications
        }, callback);
    };

    /**
     * Create a new Award
{'fraction_non_alphanumeric': 0.12570180910792264, 'fraction_numerical': 0.0006238303181534623, 'mean_word_length': 2.344108446298227, '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': '7435818', 'n_tokens_mistral': 907, 'n_tokens_neox': 877, 'n_words': 199}