Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def astype(value):
if isinstance(value, six.string_types) and (value[0].isdigit() or value[-1].isdigit()):
if value.isdigit():
return int(value)
else:
try:
return float(value)
except:
try:
return tifff.asbool(value)
except:
return value
else:
try:
return tifff.asbool(value)
except:
return value
def astype(value):
if isinstance(value, six.string_types) and (value[0].isdigit() or value[-1].isdigit()):
if value.isdigit():
return int(value)
else:
try:
return float(value)
except:
try:
return tifff.asbool(value)
except:
return value
else:
try:
return tifff.asbool(value)
except:
return value