<commit_before>var each = require('lodash/collection/each');
var map = require('lodash/collection/map');
var collectNodes = require('./collectNodes');
var collectNamespaceDocs = require('./collectNamespaceDocs');
var path = require('path');

module.exports = function generate(config) {

  var nodes = collectNodes(config);
  var nsDocs = collectNamespaceDocs(config);

  // generate namespaces for all nodes where have documentation
  var namespaces = {};
  each(nodes, function(node) {
    // only add nodes which are module defaults to the namespace
    if (!node.isDefault) return;

    var nsId = path.dirname(node.id);
    if (!namespaces[nsId]) {
      namespaces[nsId] = {
        type: "namespace",
        id: nsId,
        description: nsDocs[nsId],
        members: []
      };
    }<commit_msg>Extract name property for namespace nodes.<commit_after>var each = require('lodash/collection/each');
var map = require('lodash/collection/map');
var collectNodes = require('./collectNodes');
var collectNamespaceDocs = require('./collectNamespaceDocs');
var path = require('path');

module.exports = function generate(config) {

  var nodes = collectNodes(config);
  var nsDocs = collectNamespaceDocs(config);

  // generate namespaces for all nodes where have documentation
  var namespaces = {};
  each(nodes, function(node) {
    // only add nodes which are module defaults to the namespace
    if (!node.isDefault) return;

    var nsId = path.dirname(node.id);
    var name = path.basename(nsId);
    if (!namespaces[nsId]) {
      namespaces[nsId] = {
        type: "namespace",
        id: nsId,
        name: name,
        description: nsDocs[nsId],
        members: []
      };
    }
{'fraction_non_alphanumeric': 0.12713360800470866, 'fraction_numerical': 0.0, 'mean_word_length': 3.497354497354497, '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': '1173636', 'n_tokens_mistral': 487, 'n_tokens_neox': 476, 'n_words': 134}