MCPcopy Index your code
hub / github.com/dask/dask / _normalize_seq_func

Function _normalize_seq_func

dask/tokenize.py:142–156  ·  view source on GitHub ↗
(seq: Iterable[object])

Source from the content-addressed store, hash-verified

140
141
142def _normalize_seq_func(seq: Iterable[object]) -> tuple[object, ...]:
143 def _inner_normalize_token(item):
144 # Don't go through Dispatch. That's slow
145 if isinstance(item, _IDENTITY_DISPATCH):
146 return item
147 return normalize_token(item)
148
149 with tokenize_lock:
150 if id(seq) in _SEEN:
151 return "__seen", _SEEN[id(seq)][0]
152 _SEEN[id(seq)] = len(_SEEN), seq
153 try:
154 return tuple(map(_inner_normalize_token, seq))
155 finally:
156 del _SEEN[id(seq)]
157
158
159@normalize_token.register((tuple, list))

Callers 7

_tokenizeFunction · 0.85
normalize_dictFunction · 0.85
normalize_ordered_dictFunction · 0.85
normalize_setFunction · 0.85
normalize_seqFunction · 0.85
normalize_composeFunction · 0.85
normalize_partialFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…