(o)
| 193 | |
| 194 | @normalize_token.register(object) |
| 195 | def normalize_object(o): |
| 196 | method = getattr(o, "__dask_tokenize__", None) |
| 197 | if method is not None and not isinstance(o, type): |
| 198 | return method() |
| 199 | |
| 200 | if type(o) is object: |
| 201 | return _normalize_pure_object(o) |
| 202 | |
| 203 | if isinstance(o, type): |
| 204 | copyreg._slotnames(o) |
| 205 | |
| 206 | if dataclasses.is_dataclass(o) and not isinstance(o, type): |
| 207 | return _normalize_dataclass(o) |
| 208 | |
| 209 | try: |
| 210 | return _normalize_pickle(o) |
| 211 | except Exception: |
| 212 | _maybe_raise_nondeterministic( |
| 213 | f"Object {o!r} cannot be deterministically hashed. This likely " |
| 214 | "indicates that the object cannot be serialized deterministically." |
| 215 | ) |
| 216 | return uuid.uuid4().hex |
| 217 | |
| 218 | |
| 219 | _seen_objects = set() |
no test coverage detected
searching dependent graphs…