code: def prompt_choices(choices, prompt):
      num = 0
      n = len(choices)
  
      if n > 1:
          for i, choice in enumerate(choices):
              print(i + 1, choice)
  
          while True:
              end = len(choices)
              input_str = input("{}? [1-{}] ".format(prompt, end))
  
              try:
                  num = int(input_str) - 1
                  if num < 0 or num >= end:
                      raise ValueError
                  break
  
              except (TypeError, ValueError):
                  print(
                      "Invalid input: {}. Please choose from [1-{}]".format(
                          input_str, end
                      )
                  )
                  continue
  
      return choices[num]
  
imports: import os
  import json
  import subprocess
  from pathlib import Path
  import click
  import fiber
  import fiber.core
  from fiber.core import ProcessStatus
label_desc: Use image node_id 8 for calling a global function with example usage: prompt_choices(choices, prompt) and returns: choices