MCPcopy Create free account
hub / github.com/numpy/numpy / __randomstate_ctor

Function __randomstate_ctor

numpy/random/_pickle.py:61–80  ·  view source on GitHub ↗

Pickling helper function that returns a legacy RandomState-like object Parameters ---------- bit_generator_name : str String containing the core BitGenerator's name bit_generator_ctor : callable, optional Callable function that takes bit_generator_name as its on

(bit_generator_name="MT19937",
                       bit_generator_ctor=__bit_generator_ctor)

Source from the content-addressed store, hash-verified

59
60
61def __randomstate_ctor(bit_generator_name="MT19937",
62 bit_generator_ctor=__bit_generator_ctor):
63 """
64 Pickling helper function that returns a legacy RandomState-like object
65
66 Parameters
67 ----------
68 bit_generator_name : str
69 String containing the core BitGenerator's name
70 bit_generator_ctor : callable, optional
71 Callable function that takes bit_generator_name as its only argument
72 and returns an instantized bit generator.
73
74 Returns
75 -------
76 rs : RandomState
77 Legacy RandomState using the named core BitGenerator
78 """
79
80 return RandomState(bit_generator_ctor(bit_generator_name))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected