MCPcopy Create free account
hub / github.com/ScrapeGraphAI/toonify / format_size

Function format_size

benchmark/memory_benchmark.py:44–51  ·  view source on GitHub ↗

Format bytes in human-readable format.

(size_bytes: int)

Source from the content-addressed store, hash-verified

42
43
44def format_size(size_bytes: int) -> str:
45 """Format bytes in human-readable format."""
46 if size_bytes < 1024:
47 return f"{size_bytes}B"
48 elif size_bytes < 1024 * 1024:
49 return f"{size_bytes / 1024:.2f}KB"
50 else:
51 return f"{size_bytes / (1024 * 1024):.2f}MB"
52
53
54def benchmark_memory(name: str, data: dict):

Callers 2

benchmark_memoryFunction · 0.70
mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…