code: def get_user_autocompletions(ctx, args, incomplete, cmd_param):
      """
      :param ctx: context associated with the parsed command
      :param args: full list of args
      :param incomplete: the incomplete text to autocomplete
      :param cmd_param: command definition
      :return: all the possible user-specified completions for the param
      """
      results = []
      if isinstance(cmd_param.type, Choice):
          # Choices don't support descriptions.
          results = [
              (c, None)
              for c in cmd_param.type.choices
              if str(c).startswith(incomplete)
          ]
      elif cmd_param.autocompletion is not None:
          dynamic_completions = cmd_param.autocompletion(
              ctx=ctx, args=args, incomplete=incomplete
          )
          results = [
              c if isinstance(c, tuple) else (c, None)
              for c in dynamic_completions
          ]
      return results
  
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 6 for calling a global function with example usage: get_user_autocompletions(ctx, args, incomplete, cmd_param) and returns: results