code: def _python_installed(ret, python, user=None):
      '''
      Check to see if given python is installed.
      '''
      default = __salt__['pyenv.default'](runas=user)
      for version in __salt__['pyenv.versions'](user):
          if version == python:
              ret['result'] = True
              ret['comment'] = 'Requested python exists.'
              ret['default'] = default == python
              break
  
      return ref _python_installed(ret, python, user=None):
      '''
      Check to see if given python is installed.
      '''
      default = __salt__['pyenv.default'](runas=user)
      for version in __salt__['pyenv.versions'](user):
          if version == python:
              ret['result'] = True
              ret['comment'] = 'Requested python exists.'
              ret['default'] = default == python
              break
  
      return ret
docs: Check to see if given python is installed.