def get_project_or_task_completion(ctx, args, incomplete):
    """Function to autocomplete either organisations or tasks, depending on the
       shape of the current argument."""

    assert isinstance(incomplete, str)

    def get_incomplete_tag(args, incomplete):
        """Get incomplete tag from command line string."""
        cmd_line = " ".join(args + [incomplete])
        found_tags = parse_tags(cmd_line)
        return found_tags[-1] if found_tags else ""

    def fix_broken_tag_parsing(incomplete_tag):
        """
        Remove spaces from parsed tag

        The function `parse_tags` inserts a space after each character. In
        order to obtain the actual command line part, the space needs to be
        removed.
        """
        return "".join(char for char in incomplete_tag.split(" "))

    def prepend_plus(tag_suggestions):
        """
        Prepend '+' to each tag suggestion.

        For the `watson` targeted with the function
        get_project_or_task_completion, a leading plus in front of a tag is
        expected. The get_tags() suggestion generation does not include those
        as it targets other subcommands.

        In order to not destroy the current tag stub, the plus must be
        pretended.
        """
        for cur_suggestion in tag_suggestions:
            yield "+{cur_suggestion}".format(cur_suggestion=cur_suggestion)

    _bypass_click_bug_to_ensure_watson(ctx)

    project_is_completed = any(
        tok.startswith("+") for tok in args + [incomplete]
    )
    if project_is_completed:
        incomplete_tag = get_incomplete_tag(args, incomplete)
        fixed_incomplete_tag = fix_broken_tag_parsing(incomplete_tag)
        tag_suggestions = get_tags(ctx, args, fixed_incomplete_tag)
        return prepend_plus(tag_suggestions)
    else:
        return get_projects(ctx, args, incomplete)
Function to autocomplete either organisations or tasks, depending on the
       shape of the current argument.
watson/autocompletion.py