<commit_before>var data = require('../groupData.json');

exports.view = function(req, res){
	var db = require("../db")
    var classname = req.query.classname;
    var userid = req.session.userid;
    if(userid === undefined) {
        res.render('index');
    }
    // db.getGroup(function (groups) {
    //     if(groups) {
    //         res.render('viewMap', {
    //             'title' : classname,
    //             'locData' : groups
    //         });
    //     }
    // }, classname);

    var hasGroups = false;
    db.getGroup(function (groups) {
        if(groups) {
            if(groups.length > 0) {
                hasGroups = true;
            }
            groups = markIfBelongsTo(groups, userid);
            res.render('viewMap', {
                'title' : classname,
                'locData' : groups
            });
        }
    },classname);
};

function markIfBelongsTo(groups, userid) {
    for (var i = 0; i < groups.length; i++) {
        var group = groups[i];
        var index = group.memberids.indexOf(userid);
        if(index != -1) {
            group.belongsToGroup = 1;<commit_msg>removed comment<commit_after>var data = require('../groupData.json');

exports.view = function(req, res){
	var db = require("../db")
    var classname = req.query.classname;
    var userid = req.session.userid;
    if(userid === undefined) {
        res.render('index');
    }


    var hasGroups = false;
    db.getGroup(function (groups) {
        if(groups) {
            if(groups.length > 0) {
                hasGroups = true;
            }
            groups = markIfBelongsTo(groups, userid);
            res.render('viewMap', {
                'title' : classname,
                'locData' : groups
            });
        }
    },classname);
};

function markIfBelongsTo(groups, userid) {
    for (var i = 0; i < groups.length; i++) {
        var group = groups[i];
        var index = group.memberids.indexOf(userid);
        if(index != -1) {
            group.belongsToGroup = 1;
{'fraction_non_alphanumeric': 0.14823996033713435, 'fraction_numerical': 0.0039662865642042635, 'mean_word_length': 1.6906666666666668, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5767374', 'n_tokens_mistral': 629, 'n_tokens_neox': 613, 'n_words': 123}