class_docstr: Inherit from this class if you wish to override any of the stages below. Otherwise, use
  ``argcomplete.autocomplete()`` directly (it's a convenience instance of this class). It has the same signature as
  :meth:`CompletionFinder.__call__()`.
docstr: If the word under the cursor started with a quote (as indicated by a nonempty ``cword_prequote``), escapes
  occurrences of that quote character in the completions, and adds the quote to the beginning of each completion.
  Otherwise, escapes all characters that bash splits words on (``COMP_WORDBREAKS``), and removes portions of
  completions before the first colon if (``COMP_WORDBREAKS``) contains a colon.
  
  If there is only one completion, and it doesn't end with a **continuation character** (``/``, ``:``, or ``=``),
  adds a space after the completion.
  
  This method is exposed for overriding in subclasses; there is no need to use it directly.
docstr_tok: ["If","the","word","under","the","cursor","started","with","a","quote","(","as","indicated","by","a","nonempty","``","cword_prequote","``",")",",","escapes","occurrences","of","that","quote","character","in","the","completions",",","and","adds","the","quote","to","the","beginning","of","each","completion",".","Otherwise",",","escapes","all","characters","that","bash","splits","words","on","(","``","COMP_WORDBREAKS","``",")",",","and","removes","portions","of","completions","before","the","first","colon","if","(","``","COMP_WORDBREAKS","``",")","contains","a","colon",".","If","there","is","only","one","completion",",","and","it","does","n't","end","with","a","*","*","continuation","character","*","*","(","``","\/","``",",","``",":","``",",","or","``","=","``",")",",","adds","a","space","after","the","completion",".","This","method","is","exposed","for","overriding","in","subclasses",";","there","is","no","need","to","use","it","directly","."]
code: def quote_completions(
      self,
      completions: List[str],
      cword_prequote: str,
      last_wordbreak_pos: Optional[int],
  ) -> List[str]:
      """
      If the word under the cursor started with a quote (as indicated by a nonempty ``cword_prequote``), escapes
      occurrences of that quote character in the completions, and adds the quote to the beginning of each completion.
      Otherwise, escapes all characters that bash splits words on (``COMP_WORDBREAKS``), and removes portions of
      completions before the first colon if (``COMP_WORDBREAKS``) contains a colon.
  
      If there is only one completion, and it doesn't end with a **continuation character** (``/``, ``:``, or ``=``),
      adds a space after the completion.
  
      This method is exposed for overriding in subclasses; there is no need to use it directly.
      """
      special_chars = "\\"
      # If the word under the cursor was quoted, escape the quote char.
      # Otherwise, escape all special characters and specially handle all COMP_WORDBREAKS chars.
      if cword_prequote == "":
          # Bash mangles completions which contain characters in COMP_WORDBREAKS.
          # This workaround has the same effect as __ltrim_colon_completions in bash_completion
          # (extended to characters other than the colon).
          if last_wordbreak_pos:
              completions = [
                  c[last_wordbreak_pos + 1 :] for c in completions
              ]
          special_chars += "();<>|&!`$* \t\n\"'"
      elif cword_prequote == '"':
          special_chars += '"`$!'
  
      if os.environ.get("_ARGCOMPLETE_SHELL") in ("tcsh", "fish"):
          # tcsh and fish escapes special characters itself.
          special_chars = ""
      elif cword_prequote == "'":
          # Nothing can be escaped in single quotes, so we need to close
          # the string, escape the single quote, then open a new string.
          special_chars = ""
          completions = [c.replace("'", r"'\''") for c in completions]
  
      # PowerShell uses ` as escape character.
      if os.environ.get("_ARGCOMPLETE_SHELL") == "powershell":
          escape_char = "`"
          special_chars = special_chars.replace("`", "")
      else:
          escape_char = "\\"
          if os.environ.get("_ARGCOMPLETE_SHELL") == "zsh":
              # zsh uses colon as a separator between a completion and its description.
              special_chars += ":"
  
      escaped_completions = []
      for completion in completions:
          escaped_completion = completion
          for char in special_chars:
              escaped_completion = escaped_completion.replace(
                  char, escape_char + char
              )
          escaped_completions.append(escaped_completion)
          if completion in self._display_completions:
              self._display_completions[
                  escaped_completion
              ] = self._display_completions[completion]
  
      if self.append_space:
          # Similar functionality in bash was previously turned off by supplying the "-o nospace" option to complete.
          # Now it is conditionally disabled using "compopt -o nospace" if the match ends in a continuation character.
          # This code is retained for environments where this isn't done natively.
          continuation_chars = "=/:"
          if (
              len(escaped_completions) == 1
              and escaped_completions[0][-1] not in continuation_chars
          ):
              if cword_prequote == "":
                  escaped_completions[0] += " "
  
      return escaped_completions
  
imports: import argparse
  import os
  import sys
  from collections.abc import Mapping
  from typing import Callable, Dict, List, Optional, Sequence, Union
  from .None import io
  from .completers import ChoicesCompleter, FilesCompleter, SuppressCompleter
  from .io import debug, mute_stderr
  from .lexers import split_line
  from .packages._argparse import IntrospectiveArgumentParser, action_is_greedy, action_is_open, action_is_satisfied
label_desc: Use image node_id 13 for calling the CompletionFinder obj's underlying member method code with example usage: obj.quote_completions(completions, cword_prequote, last_wordbreak_pos) and returns: escaped_completions