diff --git a/gunpowder/contrib/nodes/dvid_partner_annotation_source.py b/gunpowder/contrib/nodes/dvid_partner_annotation_source.py index 400f6c68..36e182e1 100644 --- a/gunpowder/contrib/nodes/dvid_partner_annotation_source.py +++ b/gunpowder/contrib/nodes/dvid_partner_annotation_source.py @@ -13,15 +13,17 @@ logger = logging.getLogger(__name__) + def strtobool(val): val = val.lower() - if val in ('y', 'yes', 't', 'true', 'on', '1'): + if val in ("y", "yes", "t", "true", "on", "1"): return 1 - elif val in ('n', 'no', 'f', 'false', 'off', '0'): + elif val in ("n", "no", "f", "false", "off", "0"): return 0 else: raise ValueError(f"Invalid truth value: {val}") + class DvidPartnerAnnoationSourceReadException(Exception): pass