Formatter to shorten namespaces with multiple hierarchies;
If the hierarchy has more than two levels only the first and last levels are shown.
@returns {String} - shortened namespace for display
@private
170602
function () {
			if (!this.sNamespace || this.sNamespace === '/') {
				return "[" + this.sLayer + "] /";
			}

			var aSplittedNamespace = this.sNamespace.split('/');
			var sNamespaceDepth = aSplittedNamespace.length;
			if (sNamespaceDepth > 2) {
				return "[" + this.sLayer + "] .../" + aSplittedNamespace[sNamespaceDepth - 2];
			}

			return "[" + this.sLayer + "] /" + this.sNamespace[sNamespaceDepth - 1];
		}
1025997
protected function detectNamespace()
    {
        if (strpos($this->alias, '\\')) {
            $nsParts = explode('\\', $this->alias);
            $this->short = array_pop($nsParts);
            $this->namespace = implode('\\', $nsParts);
        } else {
            $this->short = $this->alias;
        }
    }
851853
function reformatProperty(next) {
    const self = this;
    paths.forEach(function(path) {
      try {
        const splitted = path.path.split('.');
        const key      = splitted.shift();
        const value    = determineValue(splitted, self[key]);

        self[key]      = nest(splitted, value);
      } catch (error) { return next(error); }
    });

    next();
  }
716039
function Namespacer(settings, callback) {
      if (settings.namespace != null) {
        this.groupNamespace = settings.namespace;
      } else {
        callback('Error: \'namespace\' is not configured');
      }
      if (settings.templates != null) {
        this.templates = settings.templates;
      } else {
        callback('Error: \'templates\' is not configured');
      }
      if (settings.skiproot != null) {
        this.skiproot = settings.skiproot;
      }
      if ((this.groupNamespace != null) && (this.templates != null)) {
        this.callback = callback;
        this.namespaces = [];
        this.result = [];
        this.init();
      }
    }
703766
function(namespace){
        //TODO - if intance...


        if ( typeof(namespace) == "undefined" || namespace == "") {
            //logger.error('gina', 'MODEL:ERR:1', 'EEMPTY: Model namespace', __stack);
            console.error(new Error('EEMPTY: Model namespace'));
        }
        var suffix = 'Entity';
        var namespace = namespace.split(/\//g);
        var bundle = namespace[0];
        namespace.shift();
        //Capitalize - Normalize
        if (namespace.length > 1) {
            for (var i; i<namespace.length; ++i)
                namespace[i] = namespace[i].substring(0, 1).toUpperCase() + namespace[i].substring(1);

            var model = namespace.join(".");
        } else {
            //Dir name.
            var modelDirName = namespace[0];
            namespace[0] = namespace[0].substring(0, 1).toUpperCase() + namespace[0].substring(1);
            var model = namespace[0];
        }

        //console.log("\nBundle", bundle);
        //console.log("Model", model);


        getContext(bundle, function(err, conf){

            if (!err) {
                configuration = conf.model;
                //console.log("CONF READY ", model, conf.path/** conf*/);
                //TODO - More tries & catches...
                //Getting Entities Manager.
                var entitiesManager = new require(conf.path)();
                //var Entities = entitiesManager[model];

                //For now, I just need the F..ing entity name.
                var modelPath = conf.path + '/' + modelDirName
                //console.log('modelPath: ', modelPath);
                fs.readdir(modelPath, function(err, files){

                    var entityName, exluded = ['index.js'];

                    //Will be in Utils.Dev.Factory soon.
                    var produce = function(entityName, i){
                        console.log("producing ", files[i]);

                        utils.config.get('gina', 'project.json', function(err, config){
                            //if (err) logger.error('gina', 'MODEL:ERR:2', 'EEMPTY: EntitySuper' + err, __stack);
                            if (err) console.error(err.stack||err.message);

                            var filename = config.paths.gina + '/model/entityFactory.js';

                            //TODO - Factory class
                            //var Factory = new Factory({source: , target: ).onComplete();
                            console.log("LOADING ", filename);
                            //Getting source.
                            loadFile(filename, entityName, function(err, source){
                                console.log("got source ", err, source);

                                try {
                                    if (entityName != "undefiend") {
                                        console.log("preparing entity ", entityName);
                                        //TODO - Would be great to implement in Utils.Dev.
                                        var EntityFactorySource = source
                                            .replace(/\{Entity\}/g, entityName)
                                            .replace(/\{Model\}/g, model);

                                        //var EntityFactory = new requireFromString(EntityFactorySource)( _this.getConfig() );
                                        var EntityFactoryClass = requireFromString(EntityFactorySource);
                                        var EntityFactory = new EntityFactoryClass( _this.getConfig() );
                                        console.log("Factory is ",  EntityFactory);

                                        //var Entity = new Entity();
                                        merge(Entity, EntityFactory, true);
                                        //console.log("\nEntity CONTENT ", Entity, " \nVS\n", EntityFactory);

                                    } else {
                                        throw new Error('Gina.Model.getContext(...): [entityName] is undefined.');
                                    }
                                } catch (err) {
                                    //logger.error('gina', 'MODEL:ERR:4', 'EEMPTY: EntitySuper\n' + err, __stack);
                                    console.error( 'EEMPTY: EntitySuper\n' + (err.stack||err.message))
                                }

                                //Entity = new entitiesManager[model]();
                                //utils.merge(_this, Entity, true);
                                console.log("EntityManager  \n",  entitiesManager,"\n VS \n",  EntityFactory);
                                if (i == files.length-1) {
                                    console.log("All done !");
                                    _this.emit('ready', false, entitiesManager);
                                    ++i;
                                }

                            })//EO loadFile

                        })//EO Utils.Config.get

                    };//EO produce

                    var i = 0;
                    while (i < files.length) {
                        //console.log("TEsting entity exclusion ",  i + ": ", exluded.indexOf(files[i]) != -1 && files[i].match(/.js/), files[i]);
                        if ( files[i].match(/.js/) && exluded.indexOf(files[i]) == -1 && !files[i].match(/.json/)) {
                            entityName = files[i].replace(/.js/, "") + suffix;
                            console.log("entityName  : ", entityName );
                            produce(entityName, i++);
                        } else if (i == files.length-1) {
                            console.log("All done !");
                            _this.emit('ready', false, entitiesManager);
                            ++i;
                        } else {
                            console.log("missed ", i, files[i]);
                            ++i;
                        }
                    }//EO while.

                });//EO fs.readdir.

            } else {
                _this.emit('ready', 'no configuration found for your model: ' + model);
                console.log("no configuration found...");
            }
        });


    }
675122
function renameRootDeclarations(path, namespace) {
  const { scope } = path;
  const oldName = path.node.name;
  const rootScope = scope.getProgramParent();
  const isRootScope = scope === rootScope;
  const newName = `${namespace}${oldName}`;
  let binding = scope.getBinding(oldName);

  if (binding) {
    if (!path.isReferenced() && shouldRenameDeclaration(oldName, path, binding, rootScope)) {
      path.node.name = newName;
      if (!isRootScope) {
        const declarationParent = getDeclarationParent(path);

        // Function declaration defines own scope, so switch to parent
        if (declarationParent.isFunctionDeclaration()) {
          binding = declarationParent.scope.parent.getBinding(oldName);
        }
      }
      // Handle references
      if (binding.referenced) {
        binding.referencePaths.forEach(path => {
          path.node.name = newName;
        });
      }
    }
  }
}
656374
def exploded_namespace_declarations(ns)
      Hash[ns.map do |prefix, uri|
             if prefix==""
               ["xmlns", uri]
             else
               [[prefix, "xmlns"], uri]
             end
           end]
    end
797409
function formatNodes(merged, notSplit) {
    // grab the class name out (if it exists)
    remainingNodes = _.reject(merged, function(i) {
      if (i["tagname"] === "class") {
        classPrefix = i["name"];
        nodes[classPrefix] = createBasicTranslation(classPrefix, "class", i, options);

        if (i["inherits"] !== undefined && i["inherits"].length > 0) 
          nodes[classPrefix]["inherits"] = i["inherits"];

        if (i["allowchild"] !== undefined) 
          nodes[classPrefix]["allowchild"] = i["allowchild"].doc;

        return true;
      }
    });

    // flag nodes that don't have doc
    // or that just contain "@todo" in the beginning
    remainingNodes = _.map(remainingNodes, function(n) {
      if (n["doc"] === undefined || /^@todo/i.test(n["doc"]))
        n.undocumented = true;

      return n;
    });

    remainingNodes = _.reject(remainingNodes, function(i) {
      var isEvent = i["tagname"] == "event";
      var isConstructor = i["tagname"] == "constructor";
      var joinChar = isEvent ? "@" : ".";

      if (classPrefix === undefined && options.globalNS) 
        classPrefix = options.globalNS;

      if (new RegExp("^" + options.globalNS + joinChar + i["name"]).test(i["original_name"]))
        className = options.globalNS;
      else
        className = classPrefix;

      memberName = [className, i["name"]].join(joinChar);

      if (memberName.lastIndexOf(".") === memberName.length - 1 && i["inheritdoc"] === undefined) {
        console.error(i);    
        console.error("FATAL".red + ": this object doesn't have a proper name. Check that your comment is written correctly. Typically, his happens when: ");
        console.error("   * A statement above is missing a semicolon--including closing function tags--see this bug: " + "http://code.google.com/p/esprima/issues/detail?id=347&thanks=347&ts=1348621099".cyan);
        console.error("   * The line above a comment is a single line comment--see this bug: " + "https://github.com/senchalabs/jsduck/issues/247".cyan);
        process.exit(1)
      }

      if (isConstructor)
        memberName = classPrefix + ".new";
      
      if (memberName.charAt(0) == ".")
        memberName = memberName.slice(1);

      if (i["tagname"] === "method" || i["tagname"] === "constructor" || isEvent) {
        nodes[memberName] = createBasicTranslation(memberName, i["tagname"], i, options);
        nodes[memberName]["signatures"] = [];
        var ret = {};

        // these next blocks don't yet handle alternate signatures...
        // but are written as if they will :)
        if (i["params"] !== undefined) {
            var sig = { "arguments": [] };
            nodes[memberName]["arguments"] = [];

            _.each(i["params"], function(p) {
              // construct the args object
              var args = {};
              args.name = p["name"];
              args.description = p["doc"];
              args.default_value = p["default"];

              args.types = [];

              // types could be multiple
              if (p["type"].indexOf("|") >= 0) {
                p["type"].split("|").forEach(function(t) {
                  args.types.push(trim(t));
                });
              }
              else if (p["type"].indexOf(",") >= 0) {
                console.warn("Warning".yellow + ": you're using ',' to separate types in " + memberName + ", use '|' instead.");
              }
              else {
                args.types.push(p["type"]);
              }

              args.optional = p["optional"];

              sig.arguments.push(args);

              // there are args on "signatures" and a separate arguments property
              nodes[memberName]["arguments"].push(args);
            });
        }

        if (i["return"] !== undefined && i["return"].type !== undefined) {
          if (i["return"].type.indexOf("[") == 0) { // TODO: probably not best to do this here
            ret.type = i["return"].type.substr(1, i["return"].type.length - 2);
            ret.isArray = true;
          }
          else {
            ret.type = i["return"].type;
          }

          ret.description = i["return"].doc;

          // there are returns on "signatures" and a separate returns property
          //nodes[memberName]["returns"].push(ret);
        }

        var pushedObj = { };

        if (_.size(nodes[memberName]["arguments"]) > 0)    
          pushedObj["arguments"] = nodes[memberName]["arguments"];

        if (_.size(ret) > 0 && ret.type !== "undefined")
          pushedObj["returns"] = [ret];

        nodes[memberName]["signatures"].push(pushedObj);

        if (isEvent) {
          if (i["cancelable"] !== undefined)
            nodes[memberName]["cancelable"] = i["cancelable"];
          if (i["bubbles"] !== undefined)
            nodes[memberName]["bubbles"] = i["bubbles"];
        }

        if (i["tagname"] === "method") {
          // avoid reinitializing on each node loop
          if (reportObject[className] === undefined) {
              reportObject[className] = {};
              reportObject[className].missingMembers = [];
          }
          
          // go through the list of what esprima said were methods
          // and make sure they have real documentation
          var funcLength = availableFunctions.length;

          for (var l = 0; l < funcLength; l++) {
            var func = availableFunctions[l];

            // we found a matching function! 
            if (func.name === i["name"]) { 
              // if it's tagged as incomplete or private, just skip it
              if (nodes[memberName]["private"] || nodes[memberName]["ignore"]) {
                // no op, we'll slice below
              }
              // now make sure the parameters match, too
              else if (func.params !== undefined) {
                _.any(func.params, function (funcArg, idx) {
                  // catch instance where args are missing documentation
                  if (idx >= nodes[memberName]["arguments"].length) {
                    reportObject[className].missingMembers.push({name: i["name"], member: nodes[memberName], reason: "Missing documented arguments"});
                    return true;
                  }
                  // catch instance where arg and func names don't match
                  else if (funcArg.name !== nodes[memberName]["arguments"][idx].name) {
                    reportObject[className].missingMembers.push({name: i["name"], member: nodes[memberName], reason: "Documented arguments missing proper name"});
                    return true;
                  }
                });
              }

              // all the doc "tests" passed, remove this method from the reporting object
              availableFunctions.splice(l, 1);
              break;
            }
          }
        }

        methodCount++;
        return true;
      }

      else if (i["tagname"] === "property") {
        nodes[memberName] = createBasicTranslation(memberName, "property", i, options);
        nodes[memberName]["signatures"] = [ { arguments: undefined, returns: [ { type: i["type"], default_value: i["default"] } ] } ];
        return true;
      }

      else if (i["tagname"] === "attribute") {
        nodes[memberName] = createBasicTranslation(memberName, "attribute", i, options);

        var returnsArray = [];

        if (i["default"] !== undefined && i["default"] !== null)
          nodes[memberName]["defaults"] = i["default"];

        if (i["type"]) {
          var types = i["type"].split("|");

          _.each(types, function(t) {
            returnsArray.push({type: trim(t)});
          });
        }

        nodes[memberName]["signatures"] = [ { arguments: undefined, returns: returnsArray } ];
        return true;
      }

      else if (i["tagname"] === "binding") {
        nodes[memberName] = createBasicTranslation(memberName, "binding", i, options);
        nodes[memberName]["signatures"] = [ { arguments: undefined, returns: [ { type: i["type"] } ] } ];
        return true;
      }

      else {
        console.warn("Warning".yellow + ": I don't know what " + i["tagname"] + " is supposed to do in " + file);
        return true;
      }
    });

    if (notSplit) {
      checkMissingFunctions(notSplit);      
      reportObject[className].documented = methodCount;
    }

    // do pre-distribute early work
    _.each(nodes, function (node, id) {
      var clone;

      // assign hierarchy helpers
      node.aliases  = [];
      node.children = [];

      // set source file of the node
      node.file = file;

      if ('class' === node.type) {
        node.subclasses = [];
      }

      // collect sections
      if ('section' === node.type) {
        list[node.id] = node;
        return;
      }

      // elements with undefined section get '' section,
      // and will be resolved later, when we'll have full
      // element list
      list[(node.section || '') + '.' + node.id] = node;

      // bound methods produce two methods with the same description but different signatures
      // E.g. Element.foo(@element, a, b) becomes
      // Element.foo(element, a, b) and Element#foo(a, b)
      if ('method' === node.type && node.bound) {
        clone = _.clone(node);
        clone.id = node.id.replace(/(.+)\.(.+)$/, '$1#$2');

        // link to methods
        node.bound = clone.id;
        clone.bound = node.id;

        // insert bound method clone
        list[(node.section || '') + '.' + clone.id] = clone;
      }
    });
  }
421438
function () {
        var prefix = '%(',
            suffix = ')',
            data = this.data,
            output = '',
            dataKey;

        output = this.__message__;
        for (dataKey in data) {

            if (data.hasOwnProperty(dataKey)) {
                output = output.replace(prefix + dataKey + suffix, '' + data[dataKey]);
            }
        }
        output = output.replace(prefix + 'code' + suffix, '' + this.code);
        output = output.replace(prefix + 'name' + suffix, '' + this.name);

        return output;
    }
198856
function expandShortNotation(node, lookup, options) {
	const classNames = node.classList.reduce((out, cl) => {
		let prefix, m;
		const originalClass = cl;

		// parse element definition (could be only one)
		if (m = cl.match(reElement)) {
			prefix = getBlockName(node, lookup, m[1]) + options.element + m[2];
			out.add(prefix);
			cl = cl.slice(m[0].length);
		}

		// parse modifiers definitions 
		if (m = cl.match(reModifier)) {
			if (!prefix) {
				prefix = getBlockName(node, lookup, m[1]);
				out.add(prefix);
			}

			out.add(`${prefix}${options.modifier}${m[2]}`);
			cl = cl.slice(m[0].length);
		}

		if (cl === originalClass) {
			// class name wasn’t modified: it’s not a BEM-specific class,
			// add it as-is into output
			out.add(originalClass);
		}

		return out;
	}, new Set());

	const arrClassNames = Array.from(classNames).filter(Boolean);
	if (arrClassNames.length) {
		node.setAttribute('class', arrClassNames.join(' '));
	}
}
182915
function parseClassName(fullClassName, namespaces) {
		const result = {};
		let className = fullClassName;
		// Extract the namespace
		if (namespaces.length) {
			const namespaceIndex = namespaces.findIndex((namespace) => {
				return className.startsWith(namespace);
			});
			if (namespaceIndex === -1) {
				return result;
			}
			const namespace = namespaces[namespaceIndex];
			result.namespace = namespace;
			className = className.substr(namespace.length);
		}
		// Handle className with helper prefixes
		const helperPrefix = className.split('-')[0];
		if (validHelperPrefixes.indexOf(helperPrefix) !== -1) {
			result.helper = helperPrefix;
			className = className.substr(helperPrefix.length + 1);
		}
		// Handle classNames with prefixes
		const patternPrefix = className.split('-')[0];
		if (validPatternPrefixes.indexOf(patternPrefix) !== -1) {
			result.pattern = patternPrefix;
			className = className.substr(patternPrefix.length + 1);
		}
		result.name = className;
		result.parts = className.split(/__|--/);
		return result;
	}
766
function getNameInitial(name) {
		var namePart = name.split(' ');
		if (namePart.length >= 2) {
			return (namePart[0].charAt(0) + namePart[namePart.length - 1].charAt(0)).toUpperCase();
		} else {
			return name.substr(0, 2);
		}
	}
366960
function() {
    this.skipSpacesAndComments();
    this.expect('(');
    this.skipSpacesAndComments();
    var node = new nodes.Feature(this.interpolate());
    this.skipSpacesAndComments();
    this.accept(':')
    this.skipSpacesAndComments();
    this.inProperty = true;
    node.expr = this.list();
    this.inProperty = false;
    this.skipSpacesAndComments();
    this.expect(')');
    this.skipSpacesAndComments();
    return node;
  }
1153608
async function _initLastTree() {
  const sections = await Section.findAll();

  lastTree = Utils.reduce(sections, (memo, section) => {
    /* eslint-disable-next-line no-param-reassign */
    memo[section.name] = {
      form: section.form,
      options: section.options,
      fields: section.fields,
    };

    return memo;
  }, {});
}
673256
def getNamespaces(self):
        
        s = set()
        for n in self.branch + self.node.ancestors():
            if self.permit(n.expns):
                s.add(n.expns)
            s = s.union(self.pset(n))
        return s
485116
function(namespaces)
{
    var self        = this;
    this.namespaces = {
        default: {}
    };

    if (namespaces && util.isArray(namespaces)) {

        namespaces.forEach(function(namespace) {
            self.namespaces[namespace] = {};
        });
    }
}
863521
function(){
        var hierarchyNames = [], i, n = this.numHierarchies;
        for (i = 0; i < n; i++) hierarchyNames[i] = this._hierarchyOrder[i];
        return hierarchyNames;
    }