(obj: Any, *keys: str)
| 421 | return text if text else None |
| 422 | |
| 423 | def _read_value(obj: Any, *keys: str) -> Any: |
| 424 | if obj is None: |
| 425 | return None |
| 426 | if isinstance(obj, dict): |
| 427 | for key in keys: |
| 428 | if key in obj: |
| 429 | return obj.get(key) |
| 430 | return None |
| 431 | |
| 432 | for key in keys: |
| 433 | if hasattr(obj, key): |
| 434 | value = getattr(obj, key, None) |
| 435 | if value is not None: |
| 436 | return value |
| 437 | |
| 438 | extra = getattr(obj, "__pydantic_extra__", None) or {} |
| 439 | for key in keys: |
| 440 | if key in extra: |
| 441 | return extra.get(key) |
| 442 | return None |
| 443 | |
| 444 | def _normalize_aspect_ratio(value: Any) -> Optional[str]: |
| 445 | raw = _normalize_str(value) |
no outgoing calls
no test coverage detected