# a = hc.fcluster(linkage, 0.95, criterion='distance')
# b, c = np.unique(a, return_counts=1)
# print(b.shape)
# print(np.sort(c))
#
# state_sets = []
# for x, y in zip(b, c):
# state_sets.append(np.where(a == x)[0])
#
# states, pmfs = state_development(test, [s for s in state_sets if len(s) > 40], sec_mode, save_append='_{}{}'.format('second_mode_', 0.95), show=True, separate_pmf=True)
# contrasts_plot(test, [s for s in state_sets if len(s) > 40], subject=subject, save_append='_{}{}'.format('second_mode_', 0.95), save=True, show=True)
# quit()
#
# single_sample = [np.argmax(z)]
# for position, index in enumerate(np.where(np.logical_and(z > 2.7e-7, xy[0] < -500))[0]):
# print(position, index, index // test.n, index % test.n)