(val)
| 31 | # Utility functions |
| 32 | # ----------------- |
| 33 | def raise_format_value_error(val): |
| 34 | raise ValueError( |
| 35 | """ |
| 36 | Invalid value of type {typ} receive as an image format specification. |
| 37 | Received value: {v} |
| 38 | |
| 39 | An image format must be specified as one of the following string values: |
| 40 | {valid_formats}""".format( |
| 41 | typ=type(val), v=val, valid_formats=sorted(format_conversions.keys()) |
| 42 | ) |
| 43 | ) |
| 44 | |
| 45 | |
| 46 | def validate_coerce_format(fmt): |
no test coverage detected