Every line of 'range float python' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.
48 def range_check(value): 49 """ Checks that *value* can be converted to a value in the range 0.0 to 1.0. 50 51 If so, it returns the floating point value; otherwise, it raises a 52 TraitError. 53 """ 54 value = float(value) 55 if 0.0 <= value <= 1.0: 56 return value 57 raise TraitError
Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code