Learning Delays Through Gradients and Through Structure: Emergence of Spatiotemporal Patterns in Spiking Neural Networks This is the source code for https://doi.org/10.3389/fncom.2024.1460309