<commit_before>/**
 * Split into declaration and initialization for better startup performance.
 */

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

module.exports = {
  /**
   * GET /projects
   * List of Project examples.
   */
  getProjects: function (req, res) {
    Projects.find({brigade: res.locals.brigade.slug}, function (err, foundProjects) {
      if (err) console.error(err)
      var allKeywords = []
      foundProjects.forEach(function(project) {
        project.keywords.forEach(function(keyword) {
          if (allKeywords.indexOf(keyword) < 0) {
            allKeywords.push(keyword)
          }
        })
      })
      res.render(res.locals.brigade.theme.slug + '/views/projects/index', {
        title: 'Projects',
        brigade: res.locals.brigade,
        projects: foundProjects,
        keywords: allKeywords.sort()
      })
    })
  },
  /**
   * GET /projects/manage
   * Manage Projects.
   */
  getProjectsManage: function (req, res) {
    Projects.find({brigade: res.locals.brigade.slug}, function (err, foundProjects) {
      if (err) console.error(err)
      console.log(foundProjects)
      res.render(res.locals.brigade.theme.slug + '/views/projects/manage', {
        title: 'Manage Projects',
        brigade: res.locals.brigade,
        projects: foundProjects
      })
    })<commit_msg>Fixes spacing to pass tests<commit_after>/**
 * Split into declaration and initialization for better startup performance.
 */

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

module.exports = {
  /**
   * GET /projects
   * List of Project examples.
   */
  getProjects: function (req, res) {
    Projects.find({brigade: res.locals.brigade.slug}, function (err, foundProjects) {
      if (err) console.error(err)
      var allKeywords = []
      foundProjects.forEach(function (project) {
        project.keywords.forEach(function (keyword) {
          if (allKeywords.indexOf(keyword) < 0) {
            allKeywords.push(keyword)
          }
        })
      })
      res.render(res.locals.brigade.theme.slug + '/views/projects/index', {
        title: 'Projects',
        brigade: res.locals.brigade,
        projects: foundProjects,
        keywords: allKeywords.sort()
      })
    })
  },
  /**
   * GET /projects/manage
   * Manage Projects.
   */
  getProjectsManage: function (req, res) {
    Projects.find({brigade: res.locals.brigade.slug}, function (err, foundProjects) {
      if (err) console.error(err)
      console.log(foundProjects)
      res.render(res.locals.brigade.theme.slug + '/views/projects/manage', {
        title: 'Manage Projects',
        brigade: res.locals.brigade,
        projects: foundProjects
      })
    })
{'fraction_non_alphanumeric': 0.1348314606741573, 'fraction_numerical': 0.000749063670411985, 'mean_word_length': 2.5191040843214756, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2936598', 'n_tokens_mistral': 855, 'n_tokens_neox': 849, 'n_words': 158}