cosmics.py: python implementation of L.A.Cosmic