(size: int)
| 164 | |
| 165 | |
| 166 | def human_size(size: int) -> str: |
| 167 | value = float(size) |
| 168 | for unit in ("B", "KB", "MB", "GB", "TB"): |
| 169 | if value < 1024 or unit == "TB": |
| 170 | return f"{value:6.1f}{unit}" |
| 171 | value /= 1024 |
| 172 | return f"{value:6.1f}TB" |
| 173 | |
| 174 | |
| 175 | def main() -> None: |
no outgoing calls
no test coverage detected
searching dependent graphs…