import six


def is_user_want_to_overwrite_filename(filename):
    """
    Ask question in the shell and returns true if the user want to overwrite
    a file passed in parameter.

    :param str filename: The filename it asks for
    :rtype: bool
    """
    while True:
        question = "Do you want to overwrite the file '%s' (y/n): " % filename
        answer = six.moves.input(question)
        answer = answer.strip().lower()
        if answer in ["y", "yes", "n", "no"]:
            break
    return answer in ["y", "yes"]