def remove_old_logs(self, log_timeout):
    # If we have state information beyond what function to use,
    # load the last seen cursor.
    if (len(self.groomer_state) > 1 and
      self.groomer_state[0] == self.CLEAN_LOGS_TASK):
      last_cursor = Cursor(self.groomer_state[1])
    else:
      last_cursor = None

    self.register_db_accessor(constants.DASHBOARD_APP_ID)
    if log_timeout:
      timeout = (datetime.datetime.utcnow() -
        datetime.timedelta(seconds=log_timeout))
      query = RequestLogLine.query(RequestLogLine.timestamp < timeout)
      logging.debug("The timeout time is {0}".format(timeout))
    else:
      query = RequestLogLine.query()
    counter = 0
    logging.debug("The current time is {0}".format(datetime.datetime.utcnow()))

    while True:
      entities, next_cursor, more = query.fetch_page(self.BATCH_SIZE,
        start_cursor=last_cursor)
      for entity in entities:
        logging.debug("Removing {0}".format(entity))
        entity.key.delete()
        counter += 1
      if time.time() > self.last_logged + self.LOG_PROGRESS_FREQUENCY:
        logging.info('Removed {} log entries.'.format(counter))
        self.last_logged = time.time()
      if more:
        last_cursor = next_cursor
        self.update_groomer_state([self.CLEAN_LOGS_TASK,
          last_cursor.urlsafe()])
      else:
        break
    logging.info("Removed {0} log entries.".format(counter))
    return True
Read the results of a previous calculation from the directory
dataset/ETHPy150Open AppScale/appscale/AppDB/groomer.py/DatastoreGroomer.remove_old_logs--crossover with--dataset/ETHPy150Open scikit-learn/scikit-learn/sklearn/externals/joblib/memory.py/MemorizedFunc.load_output