/
leksindn
/
passwork-python
Обзор
Документация
Войти
/
leksindn
/
passwork-python
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
passwork_client/modules/batch.py
24 строки
697 B
passwork
Версия 0.2.0
09 апр 2026, 15:58
09 апр 2026, 15:58
d6a3634
Код
Авторство
О чём код?
class Batch: """ Batch request method """ def send_batch(self, requests: list): batch = 25 response = [] batch_requests = [requests[i:i + batch] for i in range(0, len(requests), batch)] for batch_request in batch_requests: response.extend(self.batch_request(batch_request)) return response def batch_request(self, requests: list): responses = self.call("POST", "/api/v1/batch", {"requests": requests}) response_data = [] for response in responses["responses"]: if response["statusCode"] == 200: response_data.append(response["body"]) return response_data