
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

from six.moves import input


def confirm(msg):
    while True:
        try:
            res = input(msg)
            res = res.strip().lower()
        except KeyboardInterrupt:
            print()
            return False
        if res in ("no", ""):
            return False
        if res == "yes":
            return True
