Ensure that this value remains this value in a dask graph Some values in dask graph take on special meaning. Sometimes we want to ensure that our data is not interpreted but remains literal. >>> add = lambda x, y: x + y >>> quote((add, 1, 2)) (literal ,)
(x)
| 520 | |
| 521 | |
| 522 | def quote(x): |
| 523 | """Ensure that this value remains this value in a dask graph |
| 524 | |
| 525 | Some values in dask graph take on special meaning. Sometimes we want to |
| 526 | ensure that our data is not interpreted but remains literal. |
| 527 | |
| 528 | >>> add = lambda x, y: x + y |
| 529 | >>> quote((add, 1, 2)) |
| 530 | (literal<type=tuple>,) |
| 531 | """ |
| 532 | if istask(x) or type(x) is list or type(x) is dict: |
| 533 | return (literal(x),) |
| 534 | return x |
| 535 | |
| 536 | |
| 537 | def reshapelist(shape, seq): |
searching dependent graphs…