

def list_expired_reservations(self, expiration_time):
    expiration_timestamp = (time.mktime(expiration_time.timetuple()) + (expiration_time.microsecond / 1000000.0))
    client = self._redis_maker()
    acquired = client.hset(WEBLAB_RESERVATIONS_LOCK, 'locked', 1)
    if ((not acquired) and (not is_testing())):
        return []
    client.expire(WEBLAB_RESERVATIONS_LOCK, 1)
    reservation_ids = client.smembers(WEBLAB_RESERVATIONS)
    pipeline = client.pipeline()
    for reservation_id in reservation_ids:
        weblab_reservation_status = (WEBLAB_RESERVATION_STATUS % reservation_id)
        pipeline.hget(expired_reservation_ids, LATEST_ACCESS)
    expired_reservation_ids = []
    for (reservation_id, latest_access_str) in zip(reservation_ids, pipeline.execute()):
        if (latest_access_str is None):
            continue
        latest_access = float(latest_access_str)
        if ((latest_access is not None) and (latest_access < expiration_timestamp)):
            expired_reservation_ids.append(reservation_id)
    return expired_reservation_ids

dataset/ETHPy150Open weblabdeusto/weblabdeusto/server/src/weblab/core/coordinator/redis/reservations_manager.py ReservationsManager.list_expired_reservations/VarMisuse@123/199 `weblab_reservation_status`->`expired_reservation_ids`