code: def bashcomplete(cli, prog_name, complete_var, complete_instr):
      if "_" in complete_instr:
          command, shell = complete_instr.split("_", 1)
      else:
          command = complete_instr
          shell = "bash"
  
      if command == "source":
          echo(get_completion_script(prog_name, complete_var, shell))
          return True
      elif command == "complete":
          if shell == "fish":
              return do_complete_fish(cli, prog_name)
          elif shell in {"bash", "zsh"}:
              return do_complete(cli, prog_name, shell == "zsh")
  
      return False
  
imports: import copy
  import os
  import re
  from .core import Argument
  from .core import MultiCommand
  from .core import Option
  from .parser import split_arg_string
  from .types import Choice
  from .utils import echo
label_desc: Use image node_id 12 for calling a global function with example usage: bashcomplete(cli, prog_name, complete_var, complete_instr) and returns: False, True, do_complete_fish, do_complete