def random_stochastic_matrix(n, k=None, sparse=False, format='csr', random_state=None):
 P = _random_stochastic_matrix(m=n, n=n, k=k, sparse=sparse, format=format, random_state=random_state)
 return P

def random_stochastic_matrix ( n , k = None , sparse = False , format = 'csr' , random_state = None ) : P = _random_stochastic_matrix ( m = n , n = n , k = k , sparse = sparse , format = format , random_state = random_state ) return P
return a randomly sampled n x n stochastic matrix with k nonzero entries for each row .