def get_updown_lengths(durations):
    """Returns the length of all up- and down-states for each node"""
    ups = []
    downs = []
    for i, l in enumerate(durations):
        ups.append([u[1] for u in l if u[0] == 1.0])
        downs.append([u[1] for u in l if u[0] == 0.0])
    return ups, downs