def strtobool(val): if isinstance(val, bool): return val try: return _stb(str(val)) except ValueError: val = val.lower() if val == "enable": return 1 if val == "disable": return 0 raise
def strtobool(val): if isinstance(val, bool): return val return _stb(str(val))