(rect: str)
| 91 | return result |
| 92 | |
| 93 | def rect2tuple(rect: str) -> tuple[int, int, int, int]: |
| 94 | if rect is None or type(rect) != type('str'): |
| 95 | return None |
| 96 | rect = rect.strip() |
| 97 | if rect.count(',') != 3: |
| 98 | return None |
| 99 | rect = rect.split(',') |
| 100 | rect = [float(r) for r in rect] |
| 101 | return tuple(rect) |