/
vshmidt
/
pytorch
Обзор
Документация
Войти
/
vshmidt
/
pytorch
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
tools/shared/logging_utils.py
19 строк
503 B
Zain Rizvi
Test Reordering: Run previously failing tests first (#101123)
16 май 2023, 22:57
16 май 2023, 22:57
b147401
Код
Авторство
О чём код?
def pluralize(count: int, singular_word: str, plural_word: str = "") -> str: if count == 1: return f"{count} {singular_word}" if not plural_word: plural_word = f"{singular_word}s" return f"{count} {plural_word}" def duration_to_str(seconds: float) -> str: if seconds < 0.00001: return "0s" elif seconds < 60: return f"{seconds:.1f}s" elif seconds < 3600: return f"{seconds / 60:.1f}m" else: return f"{seconds / 3600:.1f}h"