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

Function ensure_set

dask/utils.py:1400–1412  ·  view source on GitHub ↗

Convert a generic Set into a set. Parameters ---------- s : Set copy : bool If True, guarantee that the return value is always a shallow copy of s; otherwise it may be the input itself.

(s: Set[T], *, copy: bool = False)

Source from the content-addressed store, hash-verified

1398
1399
1400def ensure_set(s: Set[T], *, copy: bool = False) -> set[T]:
1401 """Convert a generic Set into a set.
1402
1403 Parameters
1404 ----------
1405 s : Set
1406 copy : bool
1407 If True, guarantee that the return value is always a shallow copy of s;
1408 otherwise it may be the input itself.
1409 """
1410 if type(s) is set:
1411 return s.copy() if copy else s
1412 return set(s)
1413
1414
1415class OperatorMethodMixin:

Callers 1

test_ensure_setFunction · 0.90

Calls 2

setClass · 0.85
copyMethod · 0.45

Tested by 1

test_ensure_setFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…