def mock_data_row(dim=1000, prob_nnz=0.5, lam=1.0):
 nnz = np.random.uniform(size=(dim,))
 data = [(i, float((np.random.poisson(lam=lam) + 1.0))) for i in xrange(dim) if (nnz[i] < prob_nnz)]
 return data

def mock_data_row ( dim = 1000 , prob_nnz = 0.5 , lam = 1.0 ) : nnz = np . random . uniform ( size = ( dim , ) ) data = [ ( i , float ( ( np . random . poisson ( lam = lam ) + 1.0 ) ) ) for i in xrange ( dim ) if ( nnz [ i ] < prob_nnz ) ] return data
create a random gensim sparse vector .