Return subpackages of package *name*
429356
def get_subpackages(name):
    """"""
    splist = []
    for dirpath, _dirnames, _filenames in os.walk(name):
        if osp.isfile(osp.join(dirpath, '__init__.py')):
            splist.append(".".join(dirpath.split(os.sep)))
    return splist
121639
function getPackagesTasks(baseTask) {
	var packages = getPackages();
	var tasks = [];

	for (index = 0; index < packages.length; ++index) {
	    tasks.push(baseTask + '.' + packages[index]);
	}

	return tasks;
}
359888
def submodules(self):
        
        submodules = []
        submodules.extend(self.modules)
        for p in self.packages:
            submodules.extend(p.submodules)
        return submodules
1313261
def _get_package_data():
    
    from os import listdir as ls
    from os.path import join as jn

    x = 'init'
    b = jn('serv', x)
    dr = ['binaries', 'templates']
    return [jn(x, d, f) for d in ls(b) if d in dr for f in ls(jn(b, d))]
691447
function getAllPackages () {
  const packages = [
    // main package
    {
      entry: config.entry,
      jsName: 'index',
      cssName: 'style',
      globName: config.fullname,
      amdName: config.name,
    },
  ]

  return Promise.all([
    packagesFromPath(utils.resolve('src/component'), utils.resolve('src/component')),
    packagesFromPath(utils.resolve('src/mixin'), srcPath),
    packagesFromPath(utils.resolve('src/ol-ext'), srcPath),
    packagesFromPath(utils.resolve('src/rx-ext'), srcPath),
    packagesFromPath(utils.resolve('src/util'), srcPath),
  ]).then(otherPackages => {
    return packages.concat(otherPackages.reduce((all, packages) => all.concat(packages), []))
  })
}
923608
def package_name(self, PACKAGES_TXT):
        
        packages = []
        for line in PACKAGES_TXT.splitlines():
            if line.startswith("PACKAGE NAME:"):
                packages.append(split_package(line[14:].strip())[0])
        return packages
56827
def get_canonical_names(packages):
    """"""
    from .vendor.packaging.utils import canonicalize_name

    if not isinstance(packages, Sequence):
        if not isinstance(packages, six.string_types):
            return packages
        packages = [packages]
    return set([canonicalize_name(pkg) for pkg in packages if pkg])
800644
function getPackageExportNames(packagePath) {
  const packageMeta = getPackageMeta(packagePath);
  const packageModulePath = path.join(packagePath, packageMeta.module);
  const moduleFileSource = fs.readFileSync(packageModulePath, "utf8");
  const { body } = esprima.parseModule(moduleFileSource);

  return body.reduce((result, statement) => {
    if (statement.type === "ExportDefaultDeclaration") {
      return result.concat(["default"]);
    }

    if (statement.type === "ExportNamedDeclaration") {
      return result.concat(getNamesFromDeclaration(statement));
    }

    return result;
  }, []);
}
328427
def find_packages_by_root_package(where):
    
    root_package = os.path.basename(where)
    packages = [ "%s.%s" % (root_package, sub_package)
                 for sub_package in find_packages(where)]
    packages.insert(0, root_package)
    return packages
420393
def get_module_names(package_path, pattern="lazy_*.py*"):
  
  package_contents = glob(os.path.join(package_path[0], pattern))
  relative_path_names = (os.path.split(name)[1] for name in package_contents)
  no_ext_names = (os.path.splitext(name)[0] for name in relative_path_names)
  return sorted(set(no_ext_names))
537514
def getGolangPackages(self):
		

		packages = {}

		# get all packages
		url = "%s/packages" % self.base_url
		params = {"pattern": "golang-*", "limit": 200}
		response = requests.get(url, params=params)
		if response.status_code != requests.codes.ok:
			return {}

		data = response.json()
		for package in data["packages"]:
			packages[package["name"]] = self._processPackageData(package)

		# accumulate packages from all pages
		for page in range(2, data["page_total"] + 1):
			params = {"pattern": "golang-*", "limit": 200, "page": page}
			response = requests.get(url, params=params)
			if response.status_code != requests.codes.ok:
				continue

			data = response.json()
			for package in data["packages"]:
				packages[package["name"]] = self._processPackageData(package)

		# get branches of all packages
		MAX_LEN = 30
		# break the list of packages into lists of at most 50 packages
		package_names = packages.keys()

		packages_total = len(package_names)
		packages_counter = 0
		logger.info("%s packages to process" % packages_total)

		for i in range(0, packages_total, MAX_LEN):
			sublist = package_names[i:i+MAX_LEN]
			branches = self._getPackageBranches(sublist)
			for package in sublist:
				packages[package]["branches"] = branches[package]

			packages_counter = packages_counter + len(branches)
			logger.info("%s/%s packages processed" % (packages_counter, packages_total))

		return packages
1158410
function fileToPackage(d) {
  debug(d);
  if (d.startsWith('packages/node_modules/')) {
    d = d.replace('packages/node_modules/', '');
    d = d.split('/');
    if (d[0].startsWith('@')) {
      return d.slice(0, 2).join('/');
    }

    return d[0];
  }

  if (d.startsWith('docs') || d.startsWith('documentation') || d.startsWith('.github') || d.endsWith('.md')) {
    return 'docs';
  }

  return 'tooling';
}
1274432
def package_version(filename, varname):
    """"""
    _locals = {}
    with open(filename) as fp:
        exec(fp.read(), None, _locals)
    return _locals[varname]
714293
def get_package_data(name, extlist):
    """"""
    flist = []
    # Workaround to replace os.path.relpath (not available until Python 2.6):
    offset = len(name)+len(os.pathsep)
    for dirpath, _dirnames, filenames in os.walk(name):
        for fname in filenames:
            if not fname.startswith('.') and osp.splitext(fname)[1] in extlist:
                flist.append(osp.join(dirpath, fname)[offset:])
    return flist
925650
def filter_installed_packages(packages):
    """"""
    yb = yum.YumBase()
    package_list = yb.doPackageLists()
    temp_cache = {p.base_package_name: 1 for p in package_list['installed']}

    _pkgs = [p for p in packages if not temp_cache.get(p, False)]
    return _pkgs
1335250
def get():
    """"""
    pkgnames = find_packages()

    if len(pkgnames) == 0:
        raise ValueError("Can't find any packages")

    pkgname = pkgnames[0]

    content = open(join(pkgname, '__init__.py')).read()
    c = re.compile(r"__version__ *= *('[^']+'|\"[^\"]+\")")
    m = c.search(content)

    if m is None:
        raise ValueError("Can't find __version__ = ... in __init__.py")

    return m.groups()[0][1: -1]
121802
function getPackageMetaFile(answers) {
    const packageFields = ['name', 'version', 'license', 'category'];
    const packageObject = merge(pick(packageFields, answers),
        { dependencies: { 'rung-cli': '1.0.0' } });

    return {
        filename: path.join(answers.name, 'package.json'),
        content: JSON.stringify(packageObject, null, 2)
    };
}