def save(lda, ctx_type, fname, metafile):
    top_word = nested_arr_to_np(lda.getPhi())
    doc_top = nested_arr_to_np(lda.getTheta())
    W = nested_arr_to_np(lda.getDocuments(), arrarr=True)
    Z = nested_arr_to_np(lda.getZ(), arrarr=True)
    dic = file_to_dict(metafile)
    
    arrays_out = dict()
    arrays_out['W_corpus'] = np.array(np.hstack(W))
    arrays_out['W_indices'] = np.cumsum([a.size for a in W])
    arrays_out['V'] = lda.getV()
    arrays_out['iterations'] = int(dic['iteration']) # name could change
    arrays_out['Z_corpus'] = np.array(np.hstack(Z), dtype=np.int32)
    arrays_out['Z_indices'] = np.cumsum([a.size for a in Z])
    arrays_out['doc_top'] = doc_top
    arrays_out['top_word'] = top_word
    arrays_out['sum_word_top'] = (lda.getV() * float(dic['doc_prior'])) +\
                                  np.zeros(lda.getK())
    arrays_out['context_type'] = ctx_type
    arrays_out['K'] = int(dic['K'])
    arrays_out['alpha'] = float(dic['top_prior'])
    arrays_out['beta'] = float(dic['doc_prior'])
    arrays_out['log_prob_init'] = False
    """
    # log_prob_init = False for now
    dt = [('i', np.int), ('v', np.float)]
    logs = [float(dic['log_probs'])] * int(dic['iteration'])
    indices = range(0, int(dic['iteration']))
    arrays_out['log_prob_init'] = np.array(zip(indices, logs), dtype=dt)
    """
    print 'Saving LDA model to', fname
    np.savez(fname, **arrays_out)
Given a function name and alias name, check to see if the given alias exists.
dataset/ETHPy150Open inpho/vsm/vsm/extensions/lda_py4j/org/knowceans/gibbstest/LdaRoutine.py/save--crossover with--dataset/ETHPy150Open saltstack/salt/salt/modules/boto_lambda.py/alias_exists