code: def cycle_data(self, repository, cycle_interval, chunk_size, sleep_time):
          
  
          max_timestamp = datetime.datetime.now() - cycle_interval
  
          # seperate datums into chunks
          while True:
              perf_datums_to_cycle = list(self.filter(
                  repository=repository,
                  push_timestamp__lt=max_timestamp).values_list('id', flat=True)[:chunk_size])
              if not perf_datums_to_cycle:
                  # we're done!
                  break
              self.filter(id__in=perf_datums_to_cycle).delete()
              if sleep_time:
                  # Allow some time for other queries to get through
                  time.sleep(sleep_time)
  
          # also remove any signatures which are (no longer) associated with
          # a job
          for signature in PerformanceSignature.objects.filter(
                  repository=repository):
              if not self.filter(signature=signature).exists():
                  signature.delete()
docs: Delete data older than cycle_interval, splitting the target data
  into chunks of chunk_size size.