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

def _check_and_install_python(ret, python, default=False, user=None):
    '''
    Verify that python is installed, install if unavailable
    '''
    ret = _python_installed(ret, python, user=user)
    if not ret['result']:
        if __salt__['pyenv.install_python'](python, runas=user):
            ret['result'] = True
            ret['changes'][python] = 'Installed'
            ret['comment'] = 'Successfully installed python'
            ret['default'] = default
        else:
            ret['result'] = False
            ret['comment'] = 'Could not install python.'
            return ret

    if default:
        __salt__['pyenv.default'](python, runas=user)

    return ret