Mapping function from task -> consistent name. Parameters ---------- args : object Python objects that summarize the task. pure : boolean, optional If True, a consistent hash function is tried on the input. If this fails, then a unique identifier is used. If
(*args, pure=None, **kwargs)
| 390 | |
| 391 | |
| 392 | def tokenize(*args, pure=None, **kwargs): |
| 393 | """Mapping function from task -> consistent name. |
| 394 | |
| 395 | Parameters |
| 396 | ---------- |
| 397 | args : object |
| 398 | Python objects that summarize the task. |
| 399 | pure : boolean, optional |
| 400 | If True, a consistent hash function is tried on the input. If this |
| 401 | fails, then a unique identifier is used. If False (default), then a |
| 402 | unique identifier is always used. |
| 403 | """ |
| 404 | if pure is None: |
| 405 | pure = config.get("delayed_pure", False) |
| 406 | |
| 407 | if pure: |
| 408 | return _tokenize(*args, **kwargs) |
| 409 | else: |
| 410 | return str(uuid.uuid4()) |
| 411 | |
| 412 | |
| 413 | @curry |
searching dependent graphs…