def check_measurements(segment, epoch):
    assert_equals(len(segment.analogsignals), len(list(iterable(epoch.getMeasurements()))))

    measurements = dict(((m.getName(), m) for m in iterable(epoch.getMeasurements())))

    for signal in segment.analogsignals:
        m = measurements[signal.name]
        check_numeric_measurement(signal, m)
    def should_set_device_for_analog_signals(self):
        for segment, epoch in zip(self.block.segments, iterable(self.epoch_group.getEpochs())):
            measurements = dict(((m.getName(), m) for m in iterable(epoch.getMeasurements())))

            for signal in segment.analogsignals:
                m = measurements[signal.name]
                assert_equals({"amplifier.channels.{}".format(signal.annotations['channel_index'])},
                              set(iterable(m.getDevices())))