<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def do_with_python(python, cmdline, runas=None):
    '''
    Execute a python command with pyenv's shims using a specific python version.

    CLI Example:

    .. code-block:: bash

        salt '*' pyenv.do_with_python 2.0.0-p0 'gem list bundler'
        salt '*' pyenv.do_with_python 2.0.0-p0 'gem list bundler' deploy
    '''
    if python:
        cmd = 'PYENV_VERSION={0} {1}'.format(python, cmdline)
    else:
        cmd = cmdline

    return do(cmd, runas=runas)