Python implementation of the dgim algorithm: a memory lightweight datastructure to compute the number of ones in a sliding window in a stream.