(cls, data: Any)
| 283 | |
| 284 | @classmethod |
| 285 | def _normalize_data(cls, data: Any): |
| 286 | if not isinstance(data, dict): |
| 287 | return data, None |
| 288 | |
| 289 | form: dict[str, Any] = {} |
| 290 | files: list[tuple[str, tuple]] = [] |
| 291 | for key, value in data.items(): |
| 292 | if cls._is_file_storage(value): |
| 293 | files.append((key, cls._file_tuple(value))) |
| 294 | continue |
| 295 | if isinstance(value, Iterable) and not isinstance( |
| 296 | value, str | bytes | dict |
| 297 | ): |
| 298 | values = list(value) |
| 299 | if values and all(cls._is_file_storage(item) for item in values): |
| 300 | files.extend((key, cls._file_tuple(item)) for item in values) |
| 301 | continue |
| 302 | form[key] = value |
| 303 | return form, files or None |
| 304 | |
| 305 | @classmethod |
| 306 | def _normalize_files(cls, files: Any): |
no test coverage detected