def generate_data(seed, nObsTotal):
  PRNG = np.random.RandomState(seed)
  trueList = list()
  Npercomp = PRNG.multinomial(nObsTotal, w)
  X = list()
  for k in range(K):
    X.append(sample_data_from_comp(k, Npercomp[k], PRNG))
    trueList.append(k*np.ones(Npercomp[k]))
  X = np.vstack(X)
  TrueZ = np.hstack(trueList)
  # Shuffle the ordering of observations,
  #   so we don't have all examples from comp1 followed by all examples from comp2
  permIDs = PRNG.permutation(X.shape[0])
  X = X[permIDs]
  TrueZ = TrueZ[permIDs]
  return X, TrueZ
dataset/ETHPy150Open daeilkim/refinery/refinery/bnpy/bnpy-dev/demodata/HashtagK9.py/generate_data/original