a :jgÛ ã@s¤ddlmZddlmZddlmZddlmZddlm Z m Z ddl m Z ddl mZdd lmZee e ee d œZdd d œdd„Zd efdd„Zd efdd„ZdS)é)Ú annotationsé)Ú BitGenerator)Ú RandomState)ÚPhilox)ÚPCG64Ú PCG64DXSM)ÚSFC64)Ú Generator)ÚMT19937)r rrrr r zstr | type[BitGenerator])Ú bit_generatorcCs8t|tƒr|}n"|tvr"t|}ntt|ƒdƒ‚|ƒS)a( Pickling helper function that returns a bit generator object Parameters ---------- bit_generator : type[BitGenerator] or str BitGenerator class or string containing the name of the BitGenerator Returns ------- BitGenerator BitGenerator instance z$ is not a known BitGenerator module.)Ú isinstanceÚtypeÚ BitGeneratorsÚ ValueErrorÚstr)r Z bit_gen_class©rú>/usr/local/lib/python3.9/site-packages/numpy/random/_pickle.pyÚ__bit_generator_ctors   ÿrcCst|tƒrt|ƒSt||ƒƒS)aó Pickling helper function that returns a Generator object Parameters ---------- bit_generator_name : str or BitGenerator String containing the core BitGenerator's name or a BitGenerator instance bit_generator_ctor : callable, optional Callable function that takes bit_generator_name as its only argument and returns an instantized bit generator. Returns ------- rg : Generator Generator using the named core BitGenerator )r rr ©Zbit_generator_nameZbit_generator_ctorrrrÚ__generator_ctor.s rcCst|tƒrt|ƒSt||ƒƒS)aÙ 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 only argument and returns an instantized bit generator. Returns ------- rs : RandomState Legacy RandomState using the named core BitGenerator )r rrrrrrÚ__randomstate_ctorGs rN)r )Ú __future__rr rZmtrandrZ_philoxrZ_pcg64rrZ_sfc64r Z _generatorr Z_mt19937r rrrrrrrrÚs(       üÿ ÿ