def get_duration(spike_trains):
    """Return the common duration of `spike_trains`."""
    duration = spike_trains['duration'].unique()
    if len(duration) != 1:
        raise ValueError('The duration values are not all the same: {}'.
            format(duration))
    return duration[0]
