import getopt


def has_verbose_flag(argv):
    """Returns True if the -v | --verbose flag is set in argv."""
    try:
        opts, _ = getopt.getopt(argv, "v", ["verbose"])
    except getopt.GetoptError:
        return False

    for opt, _ in opts:
        if opt in ("-v", "--verbose"):
            return True