MCPcopy
hub / github.com/dask/dask / quote

Function quote

dask/core.py:522–534  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

520
521
522def 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
537def reshapelist(shape, seq):

Callers 4

delayedFunction · 0.90
pluckMethod · 0.90
test_quoteFunction · 0.90
broadcast_toFunction · 0.90

Calls 2

istaskFunction · 0.85
literalClass · 0.85

Tested by 1

test_quoteFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…