(data: Any)
| 101 | |
| 102 | |
| 103 | def exclude_unset(data: Any) -> Any: |
| 104 | if isinstance(data, dict): |
| 105 | return data.__class__( |
| 106 | (k, exclude_unset(v)) for k, v in data.items() if v is not UNSET |
| 107 | ) |
| 108 | elif isinstance(data, list): |
| 109 | return data.__class__(exclude_unset(i) for i in data if i is not UNSET) |
| 110 | elif data is UNSET: |
| 111 | return None |
| 112 | return data |
| 113 | |
| 114 | |
| 115 | def escape_tag(s: str) -> str: |