<commit_before>
// Express - View - Copyright <NAME> <<EMAIL>> (MIT Licensed)

var posix = require('posix')

exports.render = function(view, options, fn) {
  var path = set('views') + '/' + view,
      ext = extname(path),
      engine = require('support/' + ext),
      layout = options.layout || true
  posix
    .cat(path)
    .addCallback(function(content){
      halt(200, engine.parse(content, options))
    })
}<commit_msg>Added layout support<commit_after>
// Express - View - Copyright <NAME> <<EMAIL>> (MIT Licensed)

var posix = require('posix')

var render = exports.render = function(view, options) {
  var path = set('views') + '/' + view,
      ext = extname(path),
      engine = require('support/' + ext),
      layout = options.layout === undefined ? true : options.layout
  posix
    .cat(path)
    .addCallback(function(content){
      content = engine.parse(content, options)
      if (layout)
        render('layout.html.' + ext, process.mixin(options, {
          layout: false,
          locals: {
            body: content
          }
        }))
      else
        halt(200, content)
    })
}
{'fraction_non_alphanumeric': 0.15295169946332737, 'fraction_numerical': 0.005366726296958855, 'mean_word_length': 2.5636942675159236, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '1159339', 'n_tokens_mistral': 343, 'n_tokens_neox': 337, 'n_words': 84}