human
Complete this python program:
def list_worktrees(cwd, stale=False, user=None, password=None, **kwargs):
assistant
#Here is the Python code you requested.

    """.. versionadded:: 2015.8.0
    Returns information on worktrees
    .. versionchanged:: 2015.8.4
    Version 2.7.0 added the ``list`` subcommand to `git-worktree(1)`_ which
    provides a lot of additional information. The return data has been
    changed to include this information, even for pre-2.7.0 versions of
    git. In addition, if a worktree has a detached head, then any tags
    which point to the worktree\s HEAD will be included in the return data.
    .. note::
    By default, only worktrees for which the worktree directory is still
    present are returned, but this can be changed using the ``all`` and
    ``stale`` arguments (described below).
    cwd
    The path to the git checkout
    user
    User under which to run the git command. By default, the command is run
    by the user under which the minion is running.
    password
    Windows only. Required when specifying ``user``. This parameter will be
    ignored on non-Windows platforms.
    .. versionadded:: 2016.3.4
    all : False
    If ``True``, then return all worktrees tracked under
    $GIT_DIR/worktrees, including ones for which the gitdir is no longer
    present.
    stale : False
    If ``True``, return *only* worktrees whose gitdir is no longer present.
    .. note::
    Only one of ``all`` and ``stale`` can be set to ``True``.
    .. _`git-worktree(1)`: http://git-scm.com/docs/git-worktree
    CLI Examples:
    .. code-block:: bash
    salt myminion git.list_worktrees /path/to/repo
    salt myminion git.list_worktrees /path/to/repo all=True
    salt myminion git.list_worktrees /path/to/repo stale=True
    """
    if (not _check_worktree_support(failhard=True)):
        return {}
    cwd = _expand_path(cwd, user)
    kwargs = salt.utils.args.clean_kwargs(**kwargs)
    all_ = kwargs.pop('all', False)
    if kwargs:
        salt.utils.args.invalid_kwargs(kwargs)
    if (all_ and stale):
        raise CommandExecutionError("'all'    and    'stale'    cannot    both    be    set    to    True")
    def _git_tag_points_at(cwd, rev, user=None, password=None):
        '\n                                Get    any    tags    that    point    at    a\n                                '
        return _git_run(['git', 'tag', '--points-at', rev], cwd=cwd, user=user, password=password)['stdout'].splitlines()
    def _desired(is_stale, all_, stale):
        '\n                                Common    logic    to    determine    whether    or    not    to    include    the    worktree    info\n                                in    the    return    data.\n                                '
        if is_stale:
            if ((not all_) and (not stale)):
                return False
        elif stale:
            return False
        return True
    def _duplicate_worktree_path(path):
        '\n                                Log    errors    to    the    minion    log    notifying    of    duplicate    worktree    paths.\n                                These    should    not    be    there,    but    may    show    up    due    to    a    bug    in    git    2.7.0.\n                                '
        log.error('git.worktree:    Duplicate    worktree    path    {0}.    This    may    be    caused    by    a    known    issue    in    git    2.7.0    (see    http://permalink.gmane.org/gmane.comp.version-control.git/283998)'.format(path))
    tracked_data_points = ('worktree', 'HEAD', 'branch')
    ret = {}
    git_version = _LooseVersion(version(versioninfo=False))
    has_native_list_subcommand = (git_version >= _LooseVersion('2.7.0'))
    if has_native_list_subcommand:
        out = _git_run(['git', 'worktree', 'list',...