# Path: tribeflow/dataio.py
# def save_model(out_fpath, model):
# def initialize_trace(trace_fpath, num_topics, num_iter, \
#         from_=0, to=np.inf, initial_assign=None):
# 
# Path: tribeflow/dynamic.py
# def finalize_splits(nz, n_splits, splitted, Dts, Trace, nh, ns, kernel):
# def split(Dts, Trace, previous_stamps, Count_zh, Count_sz, \
#         count_h, count_z, alpha_zh, beta_zs, ll_per_z, kernel, \
#         perc=0.05, min_stamps=50):
# def correlate_counts(Count_zh, Count_sz, count_h, count_z, \
#         alpha_zh, beta_zs):
# def finalize_merge(nz, to_merge, Dts, Trace, nh, ns, kernel):
# def merge(Dts, Trace, previous_stamps, Count_zh, Count_sz, \
#         count_h, count_z, alpha_zh, beta_zs, ll_per_z, kernel):
# def fit(trace_fpath, num_topics, alpha_zh, beta_zs, kernel, \
#         residency_priors, num_iter, num_batches, mpi_mode, from_=0, to=np.inf):
#     C = np.cov(Theta_hz.T) + np.cov(Psi_sz.T)
#     C = np.triu(C, 1)
#     C = correlate_counts(Count_zh, Count_sz, count_h, count_z, \
#             alpha_zh, beta_zs)


from tribeflow import dataio
from tribeflow import dynamic
from tribeflow.tests import files
from tribeflow.kernels import ECCDFKernel
from tribeflow._eval import quality_estimate
from tribeflow._learn import fast_populate
from numpy.testing import assert_equal
from numpy.testing import assert_almost_equal
from numpy.testing import assert_array_equal
from numpy.testing import assert_array_almost_equal
import numpy as np
            dataio.initialize_trace(files.SIZE10, 2, 10)
    
    alpha_zh, beta_zs, a_ptz, b_ptz = [0.1] * 4
    ll_per_z = np.zeros(2, dtype='f8')

    Trace[:, -1] = 0
    previous_stamps._clear()
    tstamps = np.array([[1.0, 2.0, 3.0, 4.0, 5.0, 100, 200, 300, 400, 500]]).T
    tstamps = np.array(tstamps, order='C')
    previous_stamps._extend(0, tstamps[:, 0])
    
    Count_zh = np.zeros(shape=(1, Count_zh.shape[1]), dtype='i4')
    Count_sz = np.zeros(shape=(Count_sz.shape[0], 1), dtype='i4')
    count_z = np.zeros(shape=(1, ), dtype='i4')
    
    fast_populate(Trace, Count_zh, Count_sz, count_h, count_z)
    kernel = ECCDFKernel()
    kernel.build(Trace.shape[0], Count_zh.shape[0], \
            np.array([1.0, Count_zh.shape[0] - 1]))

    ll_per_z = np.zeros(1, dtype='f8')

    quality_estimate(tstamps, Trace, \
                previous_stamps, Count_zh, Count_sz, count_h, \
                count_z, alpha_zh, beta_zs, \
                ll_per_z, np.arange(Trace.shape[0], dtype='i4'), \
                kernel)
    
    Trace_new, Count_zh_new, Count_sz_new, count_z_new, \
            new_stamps, _ = \

# Path: tribeflow/dataio.py
# def save_model(out_fpath, model):
# def initialize_trace(trace_fpath, num_topics, num_iter, \
#         from_=0, to=np.inf, initial_assign=None):
# 
# Path: tribeflow/dynamic.py
# def finalize_splits(nz, n_splits, splitted, Dts, Trace, nh, ns, kernel):
# def split(Dts, Trace, previous_stamps, Count_zh, Count_sz, \
#         count_h, count_z, alpha_zh, beta_zs, ll_per_z, kernel, \
#         perc=0.05, min_stamps=50):
# def correlate_counts(Count_zh, Count_sz, count_h, count_z, \
#         alpha_zh, beta_zs):
# def finalize_merge(nz, to_merge, Dts, Trace, nh, ns, kernel):
# def merge(Dts, Trace, previous_stamps, Count_zh, Count_sz, \
#         count_h, count_z, alpha_zh, beta_zs, ll_per_z, kernel):
# def fit(trace_fpath, num_topics, alpha_zh, beta_zs, kernel, \
#         residency_priors, num_iter, num_batches, mpi_mode, from_=0, to=np.inf):
#     C = np.cov(Theta_hz.T) + np.cov(Psi_sz.T)
#     C = np.triu(C, 1)
#     C = correlate_counts(Count_zh, Count_sz, count_h, count_z, \
#             alpha_zh, beta_zs)


# Path: tribeflow/tests/test_dynamic.py
from tribeflow import dataio
from tribeflow import dynamic
from tribeflow.tests import files
from tribeflow.kernels import ECCDFKernel
from tribeflow._eval import quality_estimate
from tribeflow._learn import fast_populate
from numpy.testing import assert_equal
from numpy.testing import assert_almost_equal
from numpy.testing import assert_array_equal
from numpy.testing import assert_array_almost_equal
import numpy as np

            dataio.initialize_trace(files.SIZE10, 2, 10)
    
    alpha_zh, beta_zs, a_ptz, b_ptz = [0.1] * 4
    ll_per_z = np.zeros(2, dtype='f8')

    Trace[:, -1] = 0
    previous_stamps._clear()
    tstamps = np.array([[1.0, 2.0, 3.0, 4.0, 5.0, 100, 200, 300, 400, 500]]).T
    tstamps = np.array(tstamps, order='C')
    previous_stamps._extend(0, tstamps[:, 0])
    
    Count_zh = np.zeros(shape=(1, Count_zh.shape[1]), dtype='i4')
    Count_sz = np.zeros(shape=(Count_sz.shape[0], 1), dtype='i4')
    count_z = np.zeros(shape=(1, ), dtype='i4')
    
    fast_populate(Trace, Count_zh, Count_sz, count_h, count_z)
    kernel = ECCDFKernel()
    kernel.build(Trace.shape[0], Count_zh.shape[0], \
            np.array([1.0, Count_zh.shape[0] - 1]))

    ll_per_z = np.zeros(1, dtype='f8')

    quality_estimate(tstamps, Trace, \
                previous_stamps, Count_zh, Count_sz, count_h, \
                count_z, alpha_zh, beta_zs, \
                ll_per_z, np.arange(Trace.shape[0], dtype='i4'), \
                kernel)
    
    Trace_new, Count_zh_new, Count_sz_new, count_z_new, \
            new_stamps, _ = \

            dynamic.split(tstamps, Trace, previous_stamps, Count_zh, Count_sz, \