<commit_before>var Partial
  , Layout
  , Adapter = require('./adapters').Adapter
  , path = require('path')
  , fs = require('fs')
  , utils = require('utilities')
  , cache = {};

Partial = function (templatePath, data, parent) {
  var self = this;
  this.id = utils.string.uuid();
  this.templatePath = templatePath
  this.data = data || {};
  this.parent = parent;
  this.children = [];
  this.content = '';

  // Hang a `partial` method on the execution-context for the
  // template rendering (e.g., will be the EJS global `partial`
  // function to add sub-templates
  this.data.partial = function (templatePath, data) {
    var child = new Partial(templatePath, data, self);
    self.addChild(child);
    return '###partial###' + child.id
  };
};

Partial.prototype = new (function () {

  this.getTemplateData = function () {
    var dirs = []
      , dir
      , key
      , templatePath = this.templatePath
      , templateData;

    // Look for an exact match
    templateData = geddy.templateRegistry[templatePath];

    // No exact match, try with some directory prefixes
    if (!templateData) {
      // Loop through dirs until a registered template path is found
      // Note: Template paths are gathered at init so we don't have to
      // touch the FS when looking for templates

      // If this is a child partial, then look in the parent's directory
      if (this.parent) {
        dirs.unshift(path.dirname(this.parent.templatePath));
      }

      // Any local template directory<commit_msg>Issue #354 -- normalize paths, fix Windows breakage<commit_after>var Partial
  , Layout
  , Adapter = require('./adapters').Adapter
  , path = require('path')
  , fs = require('fs')
  , utils = require('utilities')
  , cache = {};

Partial = function (templatePath, data, parent) {
  var self = this;
  this.id = utils.string.uuid();
  this.templatePath = templatePath
  this.data = data || {};
  this.parent = parent;
  this.children = [];
  this.content = '';

  // Hang a `partial` method on the execution-context for the
  // template rendering (e.g., will be the EJS global `partial`
  // function to add sub-templates
  this.data.partial = function (templatePath, data) {
    var child = new Partial(templatePath, data, self);
    self.addChild(child);
    return '###partial###' + child.id
  };
};

Partial.prototype = new (function () {

  this.getTemplateData = function () {
    var dirs = []
      , dir
      , key
      , templatePath = path.normalize(this.templatePath)
      , templateData;

    // Look for an exact match
    templateData = geddy.templateRegistry[templatePath];

    // No exact match, try with some directory prefixes
    if (!templateData) {
      // Loop through dirs until a registered template path is found
      // Note: Template paths are gathered at init so we don't have to
      // touch the FS when looking for templates

      // If this is a child partial, then look in the parent's directory
      if (this.parent) {
        dirs.unshift(path.dirname(this.parent.templatePath));
      }

      // Any local template directory
{'fraction_non_alphanumeric': 0.12063389391979301, 'fraction_numerical': 0.0009702457956015524, 'mean_word_length': 2.813810110974106, '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': '3183879', 'n_tokens_mistral': 897, 'n_tokens_neox': 874, 'n_words': 291}