def str2bool(v):
    """
    Convert string to boolean value. Used in boolean arguments.

    :param v: value we're converting
    :type v: str
    :return: the converted value
    :rtype: bool
    """

    if isinstance(v, bool):
        return v

    return v.lower() in ('yes', 'true', 't', 'y', '1')