<commit_before>var q = require('q');
var _ = require('underscore');

// Les models
var model = require('../models/blog');

// Les services
var core = new require('./core')();
var Picture = require('./picture');

var service = _.extend(core, {

  model: model,

  getCount: function() {

    var that = this;

    return q.fcall(function() {

      return that.model
                  .count()
                  .exec()
    })
  },

  getLast: function() {

    var that = this;

    return q.fcall(function() {

      return that.model.findOne({}, {}, {sort: {'created_at' : -1}}).exec();
    })
  },

  getList: function(page) {

    var that = this;
    var size = 20;
    var start = (page - 1) * size;

    return q.fcall(function() {

      return that.model
                  .find()
                  .limit(size)
                  .skip(start)
                  .sort('-created')
                  .exec()
    })
  },

  getOne: function(id) {

    var that = this;

    return q.fcall(function() {

      return that.model.findOne({_id: id}).populate('picture').exec()
    })<commit_msg>last blog<commit_after>var q = require('q');
var _ = require('underscore');

// Les models
var model = require('../models/blog');

// Les services
var core = new require('./core')();
var Picture = require('./picture');

var service = _.extend(core, {

  model: model,

  getCount: function() {

    var that = this;

    return q.fcall(function() {

      return that.model
                  .count()
                  .exec()
    })
  },

  getLast: function() {

    var that = this;

    return q.fcall(function() {

      return that.model.findOne({}, {}, {sort: {'created_at' : 1}}).exec();
    })
  },

  getList: function(page) {

    var that = this;
    var size = 20;
    var start = (page - 1) * size;

    return q.fcall(function() {

      return that.model
                  .find()
                  .limit(size)
                  .skip(start)
                  .sort('-created')
                  .exec()
    })
  },

  getOne: function(id) {

    var that = this;

    return q.fcall(function() {

      return that.model.findOne({_id: id}).populate('picture').exec()
    })
{'fraction_non_alphanumeric': 0.1678097850937357, 'fraction_numerical': 0.003657978966620942, 'mean_word_length': 1.7943805874840357, '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': '3700579', 'n_tokens_mistral': 722, 'n_tokens_neox': 664, 'n_words': 159}