code: def select(self, opts: Union[str, List[str], List[Tuple[Any, Optional[str]]]],
                 prompt: str = 'Your choice? ') -> str:
          
          local_opts = opts
          if isinstance(opts, str):
              local_opts = list(zip(opts.split(), opts.split()))
          fulloptions = []
          for opt in local_opts:
              if isinstance(opt, str):
                  fulloptions.append((opt, opt))
              else:
                  try:
                      fulloptions.append((opt[0], opt[1]))
                  except IndexError:
                      fulloptions.append((opt[0], opt[0]))
          for (idx, (_, text)) in enumerate(fulloptions):
              self.poutput('  %2d. %s\n' % (idx + 1, text))
          while True:
              safe_prompt = rl_make_safe_prompt(prompt)
              response = input(safe_prompt)
  
              if rl_type != RlType.NONE:
                  hlen = readline.get_current_history_length()
                  if hlen >= 1 and response != '':
                      readline.remove_history_item(hlen - 1)
  
              try:
                  choice = int(response)
                  if choice < 1:
                      raise IndexError
                  result = fulloptions[choice - 1][0]
                  break
              except (ValueError, IndexError):
                  self.poutput("{!r} isn't a valid choice. Pick a number between 1 and {}:\n".format(response,
                                                                                                     len(fulloptions)))
          return result
docs: Presents a numbered menu to the user.  Modeled after
             the bash shell's SELECT.  Returns the item chosen.
  
             Argument ``opts`` can be:
  
               | a single string -> will be split into one-word options
               | a list of strings -> will be offered as options
               | a list of tuples -> interpreted as (value, text), so
                                     that the return value can differ from
                                     the text advertised to the user