def bool_from_env(var, default: bool=False) -> bool:
    "Helper for converting env string into boolean.\n\n    Returns bool True for string values: '1' or 'true', False otherwise.\n    "

    def str_to_bool(s: str) -> bool:
        return (s.lower() in ('1', 'true'))
    os_var = os.environ.get(var)
    if (os_var is None):
        return default
    else:
        return str_to_bool(os_var)
Helper for converting env string into boolean.

Returns bool True for string values: '1' or 'true', False otherwise.
def bool_from_env(var, default: bool=False) -> bool:
    "Helper for converting env string into boolean.\n\n    Returns bool True for string values: '1' or 'true', False otherwise.\n    "

    def str_to_bool(s: str) -> bool:
        return (s.lower() in ('1', 'true'))
    os_var = os.environ.get(var)
    if (os_var is None):
        return default
    else:
        return str_to_bool(os_var)