Returns a list of package contents (for Data Packages).
169171
public static ArrayList<String> listPackageContents(Map<String, Object> m) {
        ArrayList<String> acc = new ArrayList<String>();
        for (Map.Entry<String, Object> entry : m.entrySet()) {
            if (isValidPackageContent(entry.getValue())) {
                acc.add(entry.getKey());
            }
        }
        return acc;
    }
880811
def _get_packages():
    # type: () -> List[Package]
    
    return [Package(pkg_obj=pkg) for pkg in sorted(pkg_resources.working_set,
                                                   key=lambda x: str(x).lower())]
800064
protected function getModules()
    {
    	$file = json_decode( file_get_contents( $this->packagist . 'packages.json' ) )->includes;
    	$file = json_decode( file_get_contents( $this->packagist . key( $file ) ) );
    	return $this->normaliseData( $file->packages );
    }
964784
def list_packages(conn=None):
    '''
    
    '''
    close = False
    if conn is None:
        close = True
        conn = init()

    ret = []
    data = conn.execute('SELECT package FROM packages')
    for pkg in data.fetchall():
        ret.append(pkg)

    if close:
        conn.close()
    return ret
308693
def data(self):
        
        for pkg in self.installed:
            if os.path.isfile(self.meta.pkg_path + pkg):
                name = split_package(pkg)[0]
                for log in self.logs:
                    deps = Utils().read_file(self.dep_path + log)
                    for dep in deps.splitlines():
                        if name == dep:
                            if name not in self.dmap.keys():
                                self.dmap[name] = [log]
                                if not self.count_pkg:
                                    self.count_pkg = 1
                            else:
                                self.dmap[name] += [log]
        self.count_packages()
1232186
def collect_loaded_packages() -> List[Tuple[str, str]]:
    
    dists = get_installed_distributions()
    get_dist_files = DistFilesFinder()
    file_table = {}
    for dist in dists:
        for file in get_dist_files(dist):
            file_table[file] = dist
    used_dists = set()
    # we greedily load all values to a list to avoid weird
    # "dictionary changed size during iteration" errors
    for module in list(sys.modules.values()):
        try:
            dist = file_table[module.__file__]
        except (AttributeError, KeyError):
            continue
        used_dists.add(dist)
    return sorted((dist.project_name, dist.version) for dist in used_dists)
29081
def _get_package_path(self):
        """"""
        if not self.package:
            return []
        if not hasattr(self, 'package_path'):
            m = __import__(self.package)
            parts = self.package.split('.')[1:]
            self.package_path = os.path.join(os.path.dirname(m.__file__), *parts)
        return [self.package_path]
1229131
def list_packages(self, installed=True, notinstalled=True):
        """"""

        self.profile = Profile()

        # Classify packages
        installed_packages = []
        notinstalled_packages = []

        for package in self.packages:
            data = {
                'name': package,
                'version': None,
                'description': self.packages.get(package).get('description')
            }
            if package in self.profile.packages:
                data['version'] = self.profile.get_package_version(
                    package, self.get_package_release_name(package))
                installed_packages += [data]
            else:
                notinstalled_packages += [data]

        # Print tables
        terminal_width, _ = click.get_terminal_size()

        if installed and installed_packages:

            # - Print installed packages table
            click.echo('\nInstalled packages:\n')

            PACKAGELIST_TPL = ('{name:20} {description:30} {version:<8}')

            click.echo('-' * terminal_width)
            click.echo(PACKAGELIST_TPL.format(
                name=click.style('Name', fg='cyan'), version='Version',
                description='Description'))
            click.echo('-' * terminal_width)

            for package in installed_packages:
                click.echo(PACKAGELIST_TPL.format(
                    name=click.style(package.get('name'), fg='cyan'),
                    version=package.get('version'),
                    description=package.get('description')))

        if notinstalled and notinstalled_packages:

            # - Print not installed packages table
            click.echo('\nNot installed packages:\n')

            PACKAGELIST_TPL = ('{name:20} {description:30}')

            click.echo('-' * terminal_width)
            click.echo(PACKAGELIST_TPL.format(
                name=click.style('Name', fg='yellow'),
                description='Description'))
            click.echo('-' * terminal_width)

            for package in notinstalled_packages:
                click.echo(PACKAGELIST_TPL.format(
                    name=click.style(package.get('name'), fg='yellow'),
                    description=package.get('description')))
171511
protected Package[] getPackages() {
        Map<String, Package> map;
        synchronized (packages) {
            map = new HashMap<>(packages);
        }
        return map.values().toArray(new Package[map.size()]);
    }
437452
def packageInfo(self):
        """"""
        url = "%s/item.pkinfo" % self.root
        params = {'f' : 'json'}
        result = self._get(url=url,
                           param_dict=params,
                           securityHandler=self._securityHandler,
                           proxy_url=self._proxy_url,
                           proxy_port=self._proxy_port,
                           out_folder=tempfile.gettempdir())
        return result
520984
def data_directory():
    """"""
    package_directory = os.path.abspath(os.path.dirname(__file__))
    return os.path.join(package_directory, "data")
676008
def _list_packages(self, args):
        '''
        
        '''
        packages = self._pkgdb_fun('list_packages', self.db_conn)
        for package in packages:
            if self.opts['verbose']:
                status_msg = ','.join(package)
            else:
                status_msg = package[0]
            self.ui.status(status_msg)
1229492
def list(ctx):
    """"""
    log.debug('chemdataextractor.data.list')
    click.echo('Downloaded\tPackage')
    for package in PACKAGES:
        click.echo('%s\t%s' % (package.local_exists(), package.path))
838661
def get_package_data():
    """"""
    BITSIZE, LINKAGE = platform.architecture()
    files = [
        "py.typed",
        "lib/LIBTCOD-CREDITS.txt",
        "lib/LIBTCOD-LICENSE.txt",
        "lib/README-SDL.txt",
    ]
    if "win32" in sys.platform:
        if BITSIZE == "32bit":
            files += ["x86/SDL2.dll"]
        else:
            files += ["x64/SDL2.dll"]
    if sys.platform == "darwin":
        files += ["SDL2.framework/Versions/A/SDL2"]
    return files
335549
def find_packages():
    
    packages = ['pyctools']
    for root, dirs, files in os.walk(os.path.join('src', 'pyctools')):
        package = '.'.join(root.split(os.sep)[1:])
        for name in dirs:
            packages.append(package + '.' + name)
    return packages
903920
def get_packaged_files(package_name):
    
    if not os.path.isdir('dist'):
        return []
    return [os.path.join('dist', filename) for filename in os.listdir('dist')]
33278
def file_list(package, **kwargs):
    '''
    
    '''
    ret = file_dict(package)
    files = []
    for pkg_files in six.itervalues(ret['files']):
        files.extend(pkg_files)
    ret['files'] = files
    return ret