/* package-private
15936
void markCommandDone(ExecutionResult executionResult, HystrixCommandKey commandKey, HystrixThreadPoolKey threadPoolKey, boolean executionStarted) {
        HystrixThreadEventStream.getInstance().executionDone(executionResult, commandKey, threadPoolKey);
        if (executionStarted) {
            concurrentExecutionCount.decrementAndGet();
        }
    }
564483
private void enterPackageName(BufferedReader br) throws IOException {
        String suggestedRootPackage = getDefaultRootPackage() + "." + appName;
        while (true) {
            printInstruction("Enter the Java root package of your application: [" + suggestedRootPackage + "]");

            String packageNameCandidate = br.readLine();
            if (isBlank(packageNameCandidate)) {
                rootPackage = suggestedRootPackage;
                break;
            } else {
                if (isPackageNameValid(packageNameCandidate)) {
                    rootPackage = packageNameCandidate;
                    break;
                } else {
                    System.out.println("Oops! invalid Java package name.");
                    System.out.println("");
                    continue;
                }
            }
        }
    }
545350
function Package(name)
    {
        var dotBowerJson = Package._readBowerJson(name) || {};
        var overrides = globalOverrides[name] || {};

        this.name         = name;
        this.installed    = !! dotBowerJson.name;
        this.main         = overrides.main || dotBowerJson.main || [];
        this.dependencies = overrides.dependencies || dotBowerJson.dependencies || [];
    }
623849
function createConfIndex() {
        requireConf.baseUrl = requireConf.baseUrl.replace(/\/$/, '') + '/';

        // create paths index
        pathsIndex = createKVSortedIndex(requireConf.paths);

        // create mappingId index
        mappingIdIndex = createKVSortedIndex(requireConf.map, 1);
        each(
            mappingIdIndex,
            function (item) {
                item.v = createKVSortedIndex(item.v);
            }
        );

        var lastMapItem = mappingIdIndex[mappingIdIndex.length - 1];
        if (lastMapItem && lastMapItem.k === '*') {
            each(
                mappingIdIndex,
                function (item) {
                    if (item != lastMapItem) {
                        item.v = item.v.concat(lastMapItem.v);
                    }
                }
            );
        }

        // create packages index
        packagesIndex = [];
        each(
            requireConf.packages,
            function (packageConf) {
                var pkg = packageConf;
                if (typeof packageConf === 'string') {
                    pkg = {
                        name: packageConf.split('/')[0],
                        location: packageConf,
                        main: 'main'
                    };
                }

                pkg.location = pkg.location || pkg.name;
                pkg.main = (pkg.main || 'main').replace(/\.js$/i, '');
                pkg.reg = createPrefixRegexp(pkg.name);
                packagesIndex.push(pkg);
            }
        );
        packagesIndex.sort(descSorterByKOrName);

        // create urlArgs index
        urlArgsIndex = createKVSortedIndex(requireConf.urlArgs, 1);

        // create bundles index
        bundlesIndex = {};
        /* eslint-disable no-use-before-define */
        function bundlesIterator(id) {
            bundlesIndex[resolvePackageId(id)] = key;
        }
        /* eslint-enable no-use-before-define */
        for (var key in requireConf.bundles) {
            each(requireConf.bundles[key], bundlesIterator);
        }
    }
1331753
function(){
		if(initialised)
			return isnode;
		if(package && package.name && package.version)
			console.log("\n" + package.name + " v" + package.version + "\n");

		if(config && config.loader && config.loader.startupModules && config.loader.startupModules.length > 0) {
			for (var i = 0; i < config.loader.startupModules.length; i++) {
				var startMod = "isnode-mod-"+config.loader.startupModules[i];
				loadModule(startMod);
			}
		} else {
			isnode.shutdown();
			return;
		}
		if(!modules.logger || !modules.logger.log){
			if(!modules.logger)
				modules.logger = {};
			modules.logger.log = function(level, message, data){
				var currentDate = new Date();
				currentDate = currentDate.toISOString();
				console.log(currentDate + " (" + level + ") " + message);
			}
			modules.logger.log("warning", "Logger module not loaded. Using stub method.");
		}
		isnode.on("listenForExit", function(){
			var stdin = process.openStdin();
			stdin.setRawMode(true); 
			stdin.setEncoding('utf8');
			stdin.on('data', function(chunk) {
					if(chunk == "e")
						isnode.shutdown();
			});
		});
		var started = false;
		var loadListener = function(){
			isnode.removeListener("loadDependencies", loadListener);
			loadDependencies(); 
			started = true;
		}
		isnode.on("loadDependencies", loadListener); 
		var counter = 0;
		if(config.loader.timeouts.loadDependencies)
			var timeout = config.loader.timeouts.loadDependencies;
		else
			var timeout = 5000;
		var interval = setInterval(function(){
			if(started == true){
				clearInterval(interval);
			}
			if(counter >= timeout) {
				modules.logger.log("startup","ISNode System > Timed out initiating startup. Terminating application server.");
				clearInterval(interval);
				isnode.shutdown();
			}
			counter += 500;
		}, 500);
		initialised = true;
		return isnode;
	}
914572
function basePackageJson (opts) {
  opts = opts || {}
  const _name = opts.name || '<name>'
  const _version = opts.version || '1.0.0'
  const _private = opts.private || false

  var called = false

  return from({ objectMode: true }, function (size, next) {
    if (called) return next(null, null)

    const res = { name: _name, version: _version }
    if (_private) res.private = true
    res.scripts = {}
    res.dependencies = {}
    res.devDependencies = {}

    called = true
    next(null, res)
  })
}
467041
public void process(String packageNames) {

		if (packageNames == null) {
			processPackage("", true);
			return;
		}

		String[] pkgs = packageNames.split(",");
		for (int i = 0; i < pkgs.length; i++) {

			String pkg = pkgs[i].trim().replace('.', '/');

			boolean recurse = false;
			if (pkg.endsWith("**")) {
				recurse = true;
				pkg = pkg.substring(0, pkg.length() - 2);
			} else if (pkg.endsWith("*")) {
				recurse = true;
				pkg = pkg.substring(0, pkg.length() - 1);
			}
			
			pkg = trimSlash(pkg);

			processPackage(pkg, recurse);
		}
	}
1016800
@Override
    protected void extraFileActions(PackageSymbol pack, JavaFileObject fo) {
        if (fo.isNameCompatible("package", JavaFileObject.Kind.HTML)) {
            pack.sourcefile = fo;
        }
    }
1310979
public void export(Package... packages) {
        String[] pkgs = new String[packages.length];
        for (int i = 0; i < packages.length; i++) {
            pkgs[i] = packages[i].getName();
        }
        export(pkgs);
    }
1330094
function mapByDepth(rootPackage) {
    var depth = 0
      , allDeps = {}
      , superDepsList = {}
      ;

    function traverseDeps(childPackage) {
      depth += 1;

      childPackage.dependencyTree = childPackage.dependencyTree || {};
      Object.keys(childPackage.dependencyTree).forEach(function (depName) {
        var childDeps = (childPackage.dependencyTree[depName] || {}) || {}
          ;

        if (superDepsList[depName]) {
          // a dependency can't (meaning shouldn't) have a path in which it depends on itself
          // this kind of resolution isn't as important as it once was
          // since the modules can be loaded out-of-order
          return;
        }

        superDepsList[depName] = true;

        allDeps[depth] = allDeps[depth] || [];
        allDeps[depth].push(depName);

        if (childDeps) {
          traverseDeps(childDeps);
        }

        superDepsList[depName] = false;
      });

      depth -= 1;
    }

    traverseDeps(rootPackage);

    return allDeps;
  }
831591
static String fromPackageName(String packageName) {
        List<String> tokens = tokenOf(packageName);
        return fromTokens(tokens);
    }
1088404
function convertPropertyNames (context, pkg, map , root, waiting) {
	if(!map) {
		return map;
	}
	var clone = {}, value;
	for(var property in map ) {
		value = convertName(context, pkg, map, root, property, waiting);
		if(typeof value === 'string') {
			clone[value] = map[property];
		}

		// do root paths b/c we don't know if they are going to be included with the package name or not.
		if(root) {
			value = convertName(context, pkg, map, false, property, waiting);
			if(typeof value === 'string') {
				clone[value] = map[property];
			}
		}
	}
	return clone;
}
1371692
function requireToPackage(d) {
  d = d.split('/');
  if (d[0].startsWith('@')) {
    return d.slice(0, 2).join('/');
  }

  return d[0];
}
740005
function package(cb) {
    const pkgjson = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
    delete pkgjson.scripts;
    delete pkgjson.devDependencies;
    const filepath = './dist/package.json';
    fs.writeFileSync(filepath, JSON.stringify(pkgjson, null, 2), 'utf-8');
    console.log('package.json Copied to Dist Directory');
    cb();
}
380547
public FunctionDescr function( PackageDescrBuilder pkg ) throws RecognitionException {
        FunctionDescrBuilder function = null;
        try {
            function = helper.start( pkg,
                                     FunctionDescrBuilder.class,
                                     null );

            // 'function'
            match( input,
                   DRL5Lexer.ID,
                   DroolsSoftKeywords.FUNCTION,
                   null,
                   DroolsEditorType.KEYWORD );
            if ( state.failed ) return null;

            if ( input.LA( 1 ) != DRL5Lexer.ID || input.LA( 2 ) != DRL5Lexer.LEFT_PAREN ) {
                // type
                String type = type();
                if ( state.failed ) return null;
                if ( state.backtracking == 0 ) function.returnType( type );
            }

            // name
            Token id = match( input,
                              DRL5Lexer.ID,
                              null,
                              null,
                              DroolsEditorType.IDENTIFIER );
            if ( state.failed ) return null;
            if ( state.backtracking == 0 ) {
                function.name( id.getText() );
                helper.setParaphrasesValue( DroolsParaphraseTypes.FUNCTION,
                                            "\"" + id.getText() + "\"" );
            }

            // arguments
            parameters( function,
                        true );
            if ( state.failed ) return null;

            // body
            String body = chunk( DRL5Lexer.LEFT_CURLY,
                                 DRL5Lexer.RIGHT_CURLY,
                                 -1 );
            if ( state.failed ) return null;
            if ( state.backtracking == 0 ) function.body( body );

        } catch ( RecognitionException re ) {
            reportError( re );
        } finally {
            helper.end( FunctionDescrBuilder.class,
                        function );
        }
        return (function != null) ? function.getDescr() : null;
    }
382319
public final void packageOrTypeName() throws RecognitionException {
		int packageOrTypeName_StartIndex = input.index();

		try {
			if ( state.backtracking>0 && alreadyParsedRule(input, 47) ) { return; }

			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:519:5: ( Identifier ( '.' Identifier )* )
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:519:7: Identifier ( '.' Identifier )*
			{
			match(input,Identifier,FOLLOW_Identifier_in_packageOrTypeName1700); if (state.failed) return;
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:519:18: ( '.' Identifier )*
			loop65:
			while (true) {
				int alt65=2;
				int LA65_0 = input.LA(1);
				if ( (LA65_0==47) ) {
					int LA65_1 = input.LA(2);
					if ( (LA65_1==Identifier) ) {
						int LA65_2 = input.LA(3);
						if ( (synpred85_Java()) ) {
							alt65=1;
						}

					}

				}

				switch (alt65) {
				case 1 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:519:19: '.' Identifier
					{
					match(input,47,FOLLOW_47_in_packageOrTypeName1703); if (state.failed) return;
					match(input,Identifier,FOLLOW_Identifier_in_packageOrTypeName1705); if (state.failed) return;
					}
					break;

				default :
					break loop65;
				}
			}

			}

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
			if ( state.backtracking>0 ) { memoize(input, 47, packageOrTypeName_StartIndex); }

		}
	}
1344898
void buildPackagePrefix(final String className) {
        // TODO test
        final int lastPackageSeparator = className.lastIndexOf('/');
        final String packageName = className.substring(0, lastPackageSeparator == -1 ? className.length() : lastPackageSeparator);
        final String[] splitPackage = packageName.split("/");

        if (splitPackage.length >= PROJECT_PACKAGE_HIERARCHIES) {
            projectPackagePrefix = IntStream.range(0, PROJECT_PACKAGE_HIERARCHIES).mapToObj(i -> splitPackage[i]).collect(Collectors.joining("/"));
        } else {
            projectPackagePrefix = packageName;
        }
    }