<commit_before>'use strict';

var _ = require('lodash'),
  uuid = require('node-uuid');

var Router = require('koa-router'),
  body = require('koa-better-body');

module.exports = function BikeshedsController (helpers) {
  var middleware = helpers.middleware,
    auth = middleware.auth(),
    authLoadBikeshed = middleware.load('Bikeshed'),
    loadBikeshed = middleware.load('Bikeshed', {auth: false});

  var jsonBody = body(),
    multipartBody = body({
      multipart: true,
      formidable: {
        multiples: false
      }
    });

  var bikeshedRoutes = new Router()

    // public
    .get('/bikesheds', index)
    .get('/bikesheds/:bikeshed', loadBikeshed, get)
    .get('/bikesheds/:bikeshed/votes', loadBikeshed, score)

    // private
    .post('/bikesheds', auth, jsonBody, create)
    .del('/bikesheds/:bikeshed', auth, authLoadBikeshed, destroy)<commit_msg>use new loader syntax<commit_after>'use strict';

var _ = require('lodash'),
  uuid = require('node-uuid');

var Router = require('koa-router'),
  body = require('koa-better-body');

module.exports = function BikeshedsController (helpers) {
  var middleware = helpers.middleware,
    auth = middleware.auth(),
    loadBikeshed = middleware.load('Bikeshed'),
    authLoadBikeshed = middleware.load('Bikeshed', {parent: 'User'});

  var jsonBody = body(),
    multipartBody = body({
      multipart: true,
      formidable: {
        multiples: false
      }
    });

  var bikeshedRoutes = new Router()

    // public
    .get('/bikesheds', index)
    .get('/bikesheds/:bikeshed', loadBikeshed, get)
    .get('/bikesheds/:bikeshed/votes', loadBikeshed, score)

    // private
    .post('/bikesheds', auth, jsonBody, create)
    .del('/bikesheds/:bikeshed', auth, authLoadBikeshed, destroy)
{'fraction_non_alphanumeric': 0.15524079320113315, 'fraction_numerical': 0.0, 'mean_word_length': 3.5051020408163267, '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': '658085', 'n_tokens_mistral': 604, 'n_tokens_neox': 594, 'n_words': 118}