def _apply_random(func, state_data, size, args, kwargs):
 state = np.random.RandomState(state_data)
 func = getattr(state, func)
 return func(size=size, *args, **kwargs)

def _apply_random ( func , state_data , size , args , kwargs ) : state = np . random . RandomState ( state_data ) func = getattr ( state , func ) return func ( size = size , * args , ** kwargs )
apply randomstate method with seed .