def test_UniformTime_index_at():
    time1 = ts.UniformTime(t0=1000, length=10, sampling_rate=1000, time_unit='ms')
    mask = [False] * 10
    for i in range(10):
        idx = time1.index_at(ts.TimeArray(1000 + i, time_unit='ms'))
        npt.assert_equal(idx, np.array(i))
        mask[i] = True
        mask_idx = time1.index_at(ts.TimeArray(1000 + i, time_unit='ms'),
                                  boolean=True)
        npt.assert_equal(mask_idx, mask)
        if i > 0 and i < 9:
            mask[i - 1] = True
            mask[i + 1] = True

            mask_idx = time1.index_at(
                ts.TimeArray([999 + i, 1000 + i, 1001 + i],
                time_unit='ms'), boolean=True)

            npt.assert_equal(mask_idx, mask)
            mask[1 - i] = False
            mask[i + 1] = False
        mask[i] = False

#XXX Need to write these tests:

#Test the unit conversion:
#
#def test_TimeArray_unit_conversion():

#Test the overloaded __getitem__ and __setitem:
#
dataset/ETHPy150Open nipy/nitime/nitime/tests/test_timeseries.py/test_UniformTime_index_at/swapped operands of `-`