MCPcopy Create free account
hub / github.com/dask/dask / box_label

Function box_label

dask/dot.py:105–123  ·  view source on GitHub ↗

Label boxes in graph by chunk index >>> box_label(('x', 1, 2, 3)) '(1, 2, 3)' >>> box_label(('x', 123)) '123' >>> box_label('x') ''

(key, verbose=False)

Source from the content-addressed store, hash-verified

103
104
105def box_label(key, verbose=False):
106 """Label boxes in graph by chunk index
107
108 >>> box_label(('x', 1, 2, 3))
109 '(1, 2, 3)'
110 >>> box_label(('x', 123))
111 '123'
112 >>> box_label('x')
113 ''
114 """
115 if isinstance(key, tuple):
116 key = key[1:]
117 if len(key) == 1:
118 [key] = key
119 return str(key)
120 elif verbose:
121 return str(key)
122 else:
123 return ""
124
125
126def to_graphviz(

Callers 2

to_graphvizFunction · 0.85
_to_cytoscape_jsonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected