:param str packages: list like 'libavutil', 'libavformat', ...
	:rtype: dict[str]
169057
def pkgconfig(*packages, **kw):
	
	kw = kw.copy()
	flag_map = {'-I': 'include_dirs', '-L': 'library_dirs', '-l': 'libraries'}  # kwargs of :class:`Extension`
	for token in check_output(["pkg-config", "--libs", "--cflags"] + list(packages)).split():
		if token[:2] in flag_map:
			kw.setdefault(flag_map[token[:2]], []).append(token[2:])
		else:  # throw others to extra_link_args
			kw.setdefault('extra_link_args', []).append(token)
	return kw
329566
def get_package_info(package):
    """"""
    url = 'https://pypi.python.org/pypi/{}/json'.format(package)
    r = requests.get(url)
    r.raise_for_status()
    return r.json()
1153364
def lv_pack(*args):
    
    s = []
    for a in args:
        s.append('{}:{}'.format(len(a), a))
    return ''.join(s)
673549
def packages_dict(self):
        
        assert self.packages
        return dict(zip([package.name for package in self.packages], self.packages))
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
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
27453
def packages(self):
        
        pattern = re.compile(r'package:(/[^=]+\.apk)=([^\s]+)')
        packages = []
        for line in self.shell('pm', 'list', 'packages', '-f').splitlines():
            m = pattern.match(line)
            if not m:
                continue
            path, name = m.group(1), m.group(2)
            packages.append(self.Package(name, path))
        return packages
1144567
def get_locales(self, package_name):
        
        self._analyse()
        return list(self.values[package_name].keys())
1319784
def get_pkg_list(self):
        
        if self.query_command:
            cmd = self.query_command
            pkg_list = shell_out(
                cmd, timeout=0, chroot=self.chroot
            ).splitlines()

            for pkg in pkg_list:
                if '|' not in pkg:
                    continue
                elif pkg.count("|") == 1:
                    name, version = pkg.split("|")
                    release = None
                elif pkg.count("|") == 2:
                    name, version, release = pkg.split("|")
                self.packages[name] = {
                    'name': name,
                    'version': version.split(".")
                }
                release = release if release else None
                self.packages[name]['release'] = release

        return self.packages
1133187
def find_packages(path: str) -> List[str]:
    
    ret = []
    for root, _dir, files in os.walk(path):
        if '__init__.py' in files:
            ret.append(root.replace("/", "."))
    return sorted(ret)
194578
def lssitepackages_cmd(argv):
    """"""
    site = sitepackages_dir()
    print(*sorted(site.iterdir()), sep=os.linesep)
    extra_paths = site / '_virtualenv_path_extensions.pth'
    if extra_paths.exists():
        print('from _virtualenv_path_extensions.pth:')
        with extra_paths.open() as extra:
            print(''.join(extra.readlines()))
1134582
def output_format_lock(self, packages, **kwargs):
        
        self._output_config['type'] = PLAIN
        text = ''
        tmp_packages = OrderedDict()
        columns = self._config.get_columns()
        widths = {}
        for _pkg in packages.values():
            _pkg_name = _pkg.package_name
            _params = _pkg.get_params(columns, merged=True, raw=False)
            if _pkg_name not in tmp_packages:
                tmp_packages[_pkg_name] = _params
                comment = 1
                for _col in columns:
                    widths[_col] = max(widths.get(_col, len(_col)), len(str(_params.get(_col, '')))) + comment
                    comment = 0
        comment = 1
        for _col in columns:
            text += '{}{} '.format(_col, ' ' * (widths[_col] - len(_col) - comment))
            comment = 0
        text = '#{}\n'.format(text.strip())
        for _pkg_name in sorted(tmp_packages, key=lambda x: str(x).lower()):
            _pkg = tmp_packages[_pkg_name]
            line = ''
            for _col in columns:
                line += '{}{} '.format(_pkg[_col], ' ' * (widths[_col] - len(str(_pkg[_col]))))
            text += '{}\n'.format(line.strip())
        return text
1145392
def file_dict(*packages, **kwargs):
    '''
    
    '''
    errors = []
    files = {}

    for package in packages:
        cmd = ['pkg_info', '-qL', package]
        ret = __salt__['cmd.run_all'](cmd, output_loglevel='trace')
        files[package] = []
        for line in ret['stderr'].splitlines():
            errors.append(line)

        for line in ret['stdout'].splitlines():
            if line.startswith('/'):
                files[package].append(line)
            else:
                continue  # unexpected string

    ret = {'errors': errors, 'files': files}
    for field in list(ret):
        if not ret[field] or ret[field] == '':
            del ret[field]
    return ret
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)
675867
def format_daps(simple=False, skip_installed=False):
    ''''''
    lines= []
    m = metadaps()
    if not m['count']:
        logger.info('Could not find any daps')
        return
    for mdap in sorted(m['results'], key=lambda mdap: mdap['package_name']):
        if skip_installed and mdap['package_name'] in get_installed_daps():
            continue
        if simple:
            logger.info(mdap['package_name'])
        else:
            for line in _format_dap_with_description(mdap):
                lines.append(line)
    return lines
220183
def as_dict(self):
        
        return {
            'name': str(self),
            'modules': [m.as_dict() for m in self.modules],
            'packages': [p.as_dict() for p in self.packages]
        }
524544
def list_modules(root_package = 'vlcp'):
    '''
    
    '''
    pkg = __import__(root_package, fromlist=['_'])
    module_dict = OrderedDict()
    _server = Server()
    for imp, module, _ in walk_packages(pkg.__path__, root_package + '.'):
        m = __import__(module, fromlist = ['_'])
        for name, v in vars(m).items():
            if v is not None and isinstance(v, type) and issubclass(v, Module) \
                    and v is not Module \
                    and not isinstance(v, _ProxyModule) \
                    and hasattr(v, '__dict__') and 'configkey' in v.__dict__ \
                    and v.__module__ == module:
                module_name = v.__name__.lower()
                if module_name not in module_dict:
                    _inst = v(_server)
                    module_info = OrderedDict((('class', v.__module__ + '.' + v.__name__),
                                                ('dependencies', [d.__name__.lower()
                                                                  for d in v.depends]),
                                                ('classdescription', getdoc(v)),
                                                ('apis', [])))
                    if hasattr(_inst, 'apiHandler'):
                        apidefs = _inst.apiHandler.apidefs
                        module_info['apis'] = [(d[0], d[3])
                                               for d in apidefs
                                               if len(d) > 3 and \
                                               not d[0].startswith('public/')]
                    module_dict[module_name] = module_info
    return module_dict