def list_(prefix=None,
          bin_env=None,
          user=None,
          cwd=None):
    packages = {}

    pip_bin = _get_pip_bin(bin_env)

    cmd = [pip_bin, 'freeze']

    cmd_kwargs = dict(runas=user, cwd=cwd, python_shell=False)
    if bin_env and os.path.isdir(bin_env):
        cmd_kwargs['env'] = {'VIRTUAL_ENV': bin_env}

    if not prefix or prefix in ('p', 'pi', 'pip'):
        packages['pip'] = version(bin_env)

    result = __salt__['cmd.run_all'](cmd, **cmd_kwargs)
    if result['retcode'] > 0:
        raise CommandExecutionError(result['stderr'])

    for line in result['stdout'].splitlines():
        if line.startswith('-f') or line.startswith('#'):
            # ignore -f line as it contains --find-links directory
            # ignore comment lines
            continue
        elif line.startswith('-e hg+not trust'):
            # ignore hg + not trust problem
            continue
        elif line.startswith('-e'):
            line = line.split('-e ')[1]
            version_, name = line.split('#egg=')
        elif len(line.split('==')) >= 2:
            name = line.split('==')[0]
            version_ = line.split('==')[1]
        else:
            logger.error('Can\'t parse line \'{0}\''.format(line))
            continue

        if prefix:
            if name.lower().startswith(prefix.lower()):
                packages[name] = version_
        else:
            packages[name] = version_
    return packages
Tell WConfD to commit all temporary ids
dataset/ETHPy150Open saltstack/salt/salt/modules/pip.py/list_--crossover with--dataset/ETHPy150Open ganeti/ganeti/lib/config/__init__.py/ConfigWriter.CommitTemporaryIps