A toolbox for inference and learning with spiking neural networks