<commit_before>'use strict'

var getStudentsAndGroups = require('../lib/getStudentsAndGroups')

/*!
 *
 * Public
 *
 */

function getPublicResponse (request, reply) {
  var message = {
    message: '(Nothing but) Flowers'
  }
  reply(message)
}

/*!
 *
 * Buddy
 *
 */

function getStudents (request, reply) {
  var username = request.params.username
  var id = request.params.id
  var options = {
    username: username,
    search: id,
    type: 'getStudent'
  }

  getStudentsAndGroups(options, function (err, students) {
    if (err) {
      var code = err.statusCode || 520
      reply(err).code(code)
    } else {
      reply(students)
    }
  })
}

function searchStudents (request, reply) {
  var username = request.params.username
  var search = request.params.search
  var options = {
    username: username,
    search: search,
    type: 'getStudents'
  }

  getStudentsAndGroups(options, function (err, students) {
    if (err) {
      var code = err.statusCode || 520
      reply(err).code(code)
    } else {
      reply(students)
    }
  })
}

module.exports.getPublicResponse = getPublicResponse

module.exports.searchStudents = searchStudents

module.exports.getStudents = getStudents<commit_msg>Added appName<commit_after>'use strict'

var getStudentsAndGroups = require('../lib/getStudentsAndGroups')
var config = require('../config')

/*!
 *
 * Public
 *
 */

function getPublicResponse (request, reply) {
  var message = {
    message: '(Nothing but) Flowers'
  }
  reply(message)
}

/*!
 *
 * Buddy
 *
 */

function getStudents (request, reply) {
  var username = request.params.username
  var id = request.params.id
  var options = {
    appName: config.appName,
    username: username,
    search: id,
    type: 'getStudent'
  }

  getStudentsAndGroups(options, function (err, students) {
    if (err) {
      var code = err.statusCode || 520
      reply(err).code(code)
    } else {
      reply(students)
    }
  })
}

function searchStudents (request, reply) {
  var username = request.params.username
  var search = request.params.search
  var options = {
    appName: config.appName,
    username: username,
    search: search,
    type: 'getStudents'
  }

  getStudentsAndGroups(options, function (err, students) {
    if (err) {
      var code = err.statusCode || 520
      reply(err).code(code)
    } else {
      reply(students)
    }
  })
}

module.exports.getPublicResponse = getPublicResponse

module.exports.searchStudents = searchStudents

module.exports.getStudents = getStudents
{'fraction_non_alphanumeric': 0.12162162162162163, 'fraction_numerical': 0.0047694753577106515, 'mean_word_length': 3.079416531604538, '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': '3051344', 'n_tokens_mistral': 826, 'n_tokens_neox': 785, 'n_words': 179}