(timeout)
| 218 | |
| 219 | |
| 220 | def validate_timeout(timeout): |
| 221 | if timeout is not None and ( |
| 222 | not isinstance(timeout, numbers.Number) |
| 223 | or timeout <= 0 |
| 224 | or isinstance(timeout, bool) |
| 225 | ): |
| 226 | raise Exception( |
| 227 | "The timeout argument should be None or a positive value. " |
| 228 | f"Given value: {timeout}" |
| 229 | ) |
| 230 | |
| 231 | |
| 232 | def validate_loss_threshold(loss_threshold): |