Get the information items from the specified distro release file.

        Returns:
            A dictionary containing all information items.
436995
def _distro_release_info(self):
        
        if self.distro_release_file:
            # If it was specified, we use it and parse what we can, even if
            # its file name or content does not match the expected pattern.
            distro_info = self._parse_distro_release_file(
                self.distro_release_file)
            basename = os.path.basename(self.distro_release_file)
            # The file name pattern for user-specified distro release files
            # is somewhat more tolerant (compared to when searching for the
            # file), because we want to use what was specified as best as
            # possible.
            match = _DISTRO_RELEASE_BASENAME_PATTERN.match(basename)
            if match:
                distro_info['id'] = match.group(1)
            return distro_info
        else:
            try:
                basenames = os.listdir(_UNIXCONFDIR)
                # We sort for repeatability in cases where there are multiple
                # distro specific files; e.g. CentOS, Oracle, Enterprise all
                # containing `redhat-release` on top of their own.
                basenames.sort()
            except OSError:
                # This may occur when /etc is not readable but we can't be
                # sure about the *-release files. Check common entries of
                # /etc for information. If they turn out to not be there the
                # error is handled in `_parse_distro_release_file()`.
                basenames = ['SuSE-release',
                             'arch-release',
                             'base-release',
                             'centos-release',
                             'fedora-release',
                             'gentoo-release',
                             'mageia-release',
                             'mandrake-release',
                             'mandriva-release',
                             'mandrivalinux-release',
                             'manjaro-release',
                             'oracle-release',
                             'redhat-release',
                             'sl-release',
                             'slackware-version']
            for basename in basenames:
                if basename in _DISTRO_RELEASE_IGNORE_BASENAMES:
                    continue
                match = _DISTRO_RELEASE_BASENAME_PATTERN.match(basename)
                if match:
                    filepath = os.path.join(_UNIXCONFDIR, basename)
                    distro_info = self._parse_distro_release_file(filepath)
                    if 'name' in distro_info:
                        # The name is always present if the pattern matches
                        self.distro_release_file = filepath
                        distro_info['id'] = match.group(1)
                        return distro_info
            return {}
1236064
def all_versions(req):
    """"""
    import requests
    url = "https://pypi.python.org/pypi/" + req + "/json"
    return tuple(requests.get(url).json()["releases"].keys())
175897
def info(self):
        
        output = '{type}\nFile path: {path}\n'.format(
            type=type(self), path=pprint_thing(self._path))
        if self.is_open:
            lkeys = sorted(list(self.keys()))
            if len(lkeys):
                keys = []
                values = []

                for k in lkeys:
                    try:
                        s = self.get_storer(k)
                        if s is not None:
                            keys.append(pprint_thing(s.pathname or k))
                            values.append(
                                pprint_thing(s or 'invalid_HDFStore node'))
                    except Exception as detail:
                        keys.append(k)
                        values.append(
                            "[invalid_HDFStore node: {detail}]".format(
                                detail=pprint_thing(detail)))

                output += adjoin(12, keys, values)
            else:
                output += 'Empty'
        else:
            output += "File is CLOSED"

        return output
250454
def get_info(self) -> dict:
        """"""
        with suppress_stdout():
            with youtube_dl.YoutubeDL() as ydl:
                info_dict = ydl.extract_info(self.url, download=False)
                return info_dict
908357
def info_file(distro=None):
    """"""
    if not distro:
        distro = cfg['DISTRO']
    info_file_conf = distro.upper() + 'INFO_FILE'
    try:
        return cfg[info_file_conf]
    except KeyError:
        raise exception.InvalidUsage(
            why="Couldn't find config option %s for distro: %s"
                % (info_file_conf, distro))
871917
def get_metadata(dist):
    
    if not dist.has_metadata('PKG-INFO'):
        return

    msg = email.message_from_string(dist.get_metadata('PKG-INFO'))
    metadata = {}
    for header in [l for l in msg._headers]:
        metadata[header[0]] = header[1]

    return metadata
1338076
def _get_os_properties():
    
    if IS_DISTRO_INSTALLED:
        return distro.linux_distribution(full_distribution_name=False)
    return platform.linux_distribution(full_distribution_name=False)
69868
def get_single_file_info(f_path, int_path):
    
    return { 'path'     : force_unicode(int_path),
             'created'  : os.path.getctime(f_path),
             'last_mod' : os.path.getmtime(f_path)}
51919
def pypi_release(self):
        
        meta = self.distribution.metadata
        pypi = ServerProxy(self.pypi_index_url)
        releases = pypi.package_releases(meta.name)
        if releases:
            return next(iter(sorted(releases, reverse=True)))
767390
def _find_pip_info(self):
        
        res = {}
        dist = None
        dist_name = self.package_name.replace('_', '-')
        logger.debug('Checking for pip distribution named: %s', dist_name)
        for d in pip.get_installed_distributions():
            if d.project_name == dist_name:
                dist = d
        if dist is None:
            logger.debug('could not find dist matching package_name')
            return res
        logger.debug('found dist: %s', dist)
        self._pip_locations = [dist.location]
        ver, url = self._dist_version_url(dist)
        res['version'] = ver
        res['url'] = url
        # this is a bit of an ugly, lazy hack...
        req = pip.FrozenRequirement.from_dist(dist, [])
        logger.debug('pip FrozenRequirement: %s', req)
        res['requirement'] = str(req.req)
        return res
826879
def get_info(pyfile):
    ''''''
    info = {}
    info_re = re.compile(r"^__(\w+)__ = ['\"](.*)['\"]")
    with open(pyfile, 'r') as f:
        for line in f.readlines():
            match = info_re.search(line)
            if match:
                info[match.group(1)] = match.group(2)
    return info
643509
def info_file(self):
        
        sources = SBoGrep(self.prgnam).source().split()
        for source in sources:
            self.sbo_sources.append(source.split("/")[-1])
501667
def files(self):
        
        files_description = [
            [ self.project_name,
              'bootstrap',
              'BootstrapScriptFileTemplate' ],
            [ self.project_name,
              'CHANGES.txt',
              'PythonPackageCHANGESFileTemplate' ],
            [ self.project_name,
              'LICENSE.txt',
              'GPL3FileTemplate' ],
            [ self.project_name,
              'MANIFEST.in',
              'PythonPackageMANIFESTFileTemplate' ],
            [ self.project_name,
              'README.txt',
              'READMEReSTFileTemplate' ],
            [ self.project_name,
              'setup.py',
              'PythonPackageSetupFileTemplate' ],
            [ self.project_name + '/' + self.project_name.lower(),
              '__init__.py',
              None ],
            [ self.project_name + '/docs',
              'index.rst',
              None ],
        ]
        return files_description
1075405
def collect_lockfile_dependencies(lockfile_data):
    """"""
    output = {}

    for dependencyName, installedVersion in lockfile_data.items():
        output[dependencyName] = {
            'source': 'example-package-manager',
            'installed': {'name': installedVersion},
        }

    return output
1091652
def _parse_os_release(*os_release_files):
    '''
    
    '''
    ret = {}
    for filename in os_release_files:
        try:
            with salt.utils.files.fopen(filename) as ifile:
                regex = re.compile('^([\\w]+)=(?:\'|")?(.*?)(?:\'|")?$')
                for line in ifile:
                    match = regex.match(line.strip())
                    if match:
                        # Shell special characters ("$", quotes, backslash,
                        # backtick) are escaped with backslashes
                        ret[match.group(1)] = re.sub(
                            r'\\([$"\'\\`])', r'\1', match.group(2)
                        )
            break
        except (IOError, OSError):
            pass

    return ret
732484
def _get_os(self):
        '''
        
        '''
        return {
            'name': self._grain('os'),
            'family': self._grain('os_family'),
            'arch': self._grain('osarch'),
            'release': self._grain('osrelease'),
        }
701272
def get_dist(self):
        # type: () -> Distribution
        """"""
        if self.metadata_directory:
            base_dir, distinfo = os.path.split(self.metadata_directory)
            metadata = pkg_resources.PathMetadata(
                base_dir, self.metadata_directory
            )
            dist_name = os.path.splitext(distinfo)[0]
            typ = pkg_resources.DistInfoDistribution
        else:
            egg_info = self.egg_info_path.rstrip(os.path.sep)
            base_dir = os.path.dirname(egg_info)
            metadata = pkg_resources.PathMetadata(base_dir, egg_info)
            dist_name = os.path.splitext(os.path.basename(egg_info))[0]
            # https://github.com/python/mypy/issues/1174
            typ = pkg_resources.Distribution  # type: ignore

        return typ(
            base_dir,
            project_name=dist_name,
            metadata=metadata,
        )