def __get_spike_trains(spike_trains):
    'Make sure SpikeTrainsAPI object is always returned'
    if isinstance(spike_trains, six.string_types):
        return SpikeTrains.load(spike_trains)
    elif isinstance(spike_trains, (SpikeTrains, SpikeTrainsAPI)):
        return spike_trains
    raise AttributeError('Could not parse spiketrains. Pass in file-path, SpikeTrains object, or list of the previous')
Make sure SpikeTrainsAPI object is always returned
def __get_spike_trains(spike_trains):
    
    if isinstance(spike_trains, six.string_types):
        return SpikeTrains.load(spike_trains)
    elif isinstance(spike_trains, (SpikeTrains, SpikeTrainsAPI)):
        return spike_trains
    raise AttributeError('Could not parse spiketrains. Pass in file-path, SpikeTrains object, or list of the previous')