docstr: Mostly borrowed from argcomplete's unit tests
  
  Modified to take an application instead of an ArgumentParser
  
  Command is the current command being completed and point is the index
  into the command where the completion is triggered.
docstr_tok: ["Mostly","borrowed","from","argcomplete","'s","unit","tests","Modified","to","take","an","application","instead","of","an","ArgumentParser","Command","is","the","current","command","being","completed","and","point","is","the","index","into","the","command","where","the","completion","is","triggered","."]
code: def run_completer(
      self,
      app: ArgcompleteApp,
      command: str,
      point: t.Union[str, int, None] = None,
      **kwargs: t.Any,
  ) -> t.List[str]:
      """Mostly borrowed from argcomplete's unit tests
  
      Modified to take an application instead of an ArgumentParser
  
      Command is the current command being completed and point is the index
      into the command where the completion is triggered.
      """
      if point is None:
          point = str(len(command))
      # Flushing tempfile was leading to CI failures with Bad file descriptor, not sure why.
      # Fortunately we can just write to a StringIO instead.
      # print("Writing completions to temp file with mode=", write_mode)
      # from tempfile import TemporaryFile
      # with TemporaryFile(mode=write_mode) as t:
      strio = io.StringIO()
      os.environ["COMP_LINE"] = command
      os.environ["COMP_POINT"] = str(point)
  
      with pytest.raises(CustomError) as cm:
          app.argcomplete_kwargs = dict(
              output_stream=strio,
              exit_method=CustomError.exit,
              **kwargs,
          )
          app.initialize()
  
      if str(cm.value) != "0":
          raise RuntimeError(f"Unexpected exit code {cm.value}")
      out = strio.getvalue()
      return out.split(self.IFS)
  
imports: import io
  import os
  import typing
  import pytest
  from traitlets import Unicode
  from traitlets.config.application import Application
  from traitlets.config.configurable import Configurable
  from traitlets.config.loader import KVArgParseConfigLoader
label_desc: Use image node_id 2 for calling the TestArgcomplete obj's underlying member method code with example usage: obj.run_completer(app, command, point) and returns: out