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: Visits the active parsers and their actions, executes their completers or introspects them to collect their
  option strings. Returns the resulting completions as a list of strings.
  
  This method is exposed for overriding in subclasses; there is no need to use it directly.
docstr_tok: ["Visits","the","active","parsers","and","their","actions",",","executes","their","completers","or","introspects","them","to","collect","their","option","strings",".","Returns","the","resulting","completions","as","a","list","of","strings",".","This","method","is","exposed","for","overriding","in","subclasses",";","there","is","no","need","to","use","it","directly","."]
code: def collect_completions(
      self,
      active_parsers: List[argparse.ArgumentParser],
      parsed_args: argparse.Namespace,
      cword_prefix: str,
  ) -> List[str]:
      """
      Visits the active parsers and their actions, executes their completers or introspects them to collect their
      option strings. Returns the resulting completions as a list of strings.
  
      This method is exposed for overriding in subclasses; there is no need to use it directly.
      """
      completions: List[str] = []
  
      debug("all active parsers:", active_parsers)
      active_parser = active_parsers[-1]
      debug("active_parser:", active_parser)
      if self.always_complete_options or (
          len(cword_prefix) > 0
          and cword_prefix[0] in active_parser.prefix_chars
      ):
          completions += self._get_option_completions(
              active_parser, cword_prefix
          )
      debug("optional options:", completions)
  
      next_positional = self._get_next_positional()
      debug("next_positional:", next_positional)
  
      if isinstance(next_positional, argparse._SubParsersAction):
          completions += self._get_subparser_completions(
              next_positional, cword_prefix
          )
  
      completions = self._complete_active_option(
          active_parser,
          next_positional,
          cword_prefix,
          parsed_args,
          completions,
      )
      debug("active options:", completions)
      debug("display completions:", self._display_completions)
  
      return 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 10 for calling the CompletionFinder obj's underlying member method code with example usage: obj.collect_completions(active_parsers, parsed_args, cword_prefix) and returns: completions