code: def confirm(prompt='Really?', color='warning', yes_values=('y', 'yes'),
              abort_on_unconfirmed=False, abort_options=None):
      if isinstance(yes_values, str):
          yes_values = (yes_values,)
      prompt = '{prompt} [{yes_value}/N] '.format(prompt=prompt, yes_value=yes_values[0])
      if color:
          prompt = printer.colorize(prompt, color=color)
      try:
          answer = input(prompt)
      except KeyboardInterrupt:
          print()
          confirmed = False
      else:
          answer = answer.strip().lower()
          confirmed = answer in yes_values
      do_abort_on_unconfirmed = not confirmed and (
          bool(abort_on_unconfirmed) or
          (abort_on_unconfirmed == 0 and abort_on_unconfirmed is not False)
      )
      if do_abort_on_unconfirmed:
          if abort_options is None:
              abort_options = {}
          if abort_on_unconfirmed is True:
              abort_options.setdefault('return_code', 0)
          elif isinstance(abort_on_unconfirmed, int):
              abort_options.setdefault('return_code', abort_on_unconfirmed)
          elif isinstance(abort_on_unconfirmed, str):
              abort_options.setdefault('message', abort_on_unconfirmed)
          else:
              abort_options.setdefault('return_code', 0)
          abort(**abort_options)
      return confirmed