1def pluralize(count: int, singular_word: str, plural_word: str = "") -> str: 2 if count == 1: 3 return f"{count} {singular_word}" 4 5 if not plural_word: 6 plural_word = f"{singular_word}s" 7 8 return f"{count} {plural_word}" 9 10 11def duration_to_str(seconds: float) -> str: 12 if seconds < 0.00001: 13 return "0s" 14 elif seconds < 60: 15 return f"{seconds:.1f}s" 16 elif seconds < 3600: 17 return f"{seconds / 60:.1f}m" 18 else: 19 return f"{seconds / 3600:.1f}h" 20