Code for Endress, A.D. (in press). Hebbian learning can explain rhythmic neural entrainment to statistical regularities. Developmental Science. https://doi.org/10.1111/desc.13487