MCPcopy
hub / github.com/dask/dask / random_state

Method random_state

dask/dataframe/dask_expr/datasets.py:62–70  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

60
61 @functools.cached_property
62 def random_state(self):
63 npartitions = len(self._divisions()) - 1
64 ndtypes = max(len(self.operand("dtypes")), 1)
65 random_state = np.random.RandomState(self.seed)
66 n = npartitions * ndtypes
67 random_data = random_state.bytes(n * 4) # `n` 32-bit integers
68 l = list(np.frombuffer(random_data, dtype=np.uint32).reshape((n,)))
69 assert len(l) == n
70 return l
71
72 @functools.cached_property
73 def _make_timeseries_part(self):

Callers

nothing calls this directly

Calls 5

_divisionsMethod · 0.95
maxFunction · 0.85
operandMethod · 0.80
reshapeMethod · 0.80
RandomStateMethod · 0.45

Tested by

no test coverage detected