def version(bin_env=None):
    '''
    .. versionadded:: 0.17.0

    Returns the version of pip. Use ``bin_env`` to specify the path to a
    virtualenv and get the version of pip in that virtualenv.

    If unable to detect the pip version, returns ``None``.

    CLI Example:

    .. code-block:: bash

        salt '*' pip.version
    '''
    pip_bin = _get_pip_bin(bin_env)

    output = __salt__['cmd.run'](
        '{0} --version'.format(pip_bin), python_shell=False)
    try:
        return re.match(r'^pip (\S+)', output).group(1)
    except __HOLE__:
        return None
dataset/ETHPy150Open saltstack/salt/salt/modules/pip.py/version