keras/src/legacy/preprocessing/sequence.py/TimeseriesGenerator/__len__
class TimeseriesGenerator:    def __len__(self):
        return (
            self.end_index - self.start_index + self.batch_size * self.stride
        ) // (self.batch_size * self.stride)