def get_cut_spike_count(filename):
    """Reads through the cut file and returns the number of spikes in the file"""
    num_spikes = None
    with open(filename, 'rb') as f:
        for line in f:
            if 'data_start' in str(line):
                break
            elif 'Exact_cut_for' in str(line):
                num_spikes = int(line.decode(encoding='UTF-8').split(
                    'spikes: ')[1])
    return num_spikes
