Move to xautodl
This commit is contained in:
12
xautodl/config_utils/args_utils.py
Normal file
12
xautodl/config_utils/args_utils.py
Normal file
@@ -0,0 +1,12 @@
|
||||
import argparse
|
||||
|
||||
|
||||
def arg_str2bool(v):
|
||||
if isinstance(v, bool):
|
||||
return v
|
||||
elif v.lower() in ("yes", "true", "t", "y", "1"):
|
||||
return True
|
||||
elif v.lower() in ("no", "false", "f", "n", "0"):
|
||||
return False
|
||||
else:
|
||||
raise argparse.ArgumentTypeError("Boolean value expected.")
|
Reference in New Issue
Block a user