code: 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 ref _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
docs: Verify that python is installed, install if unavailable