Returns a human readable string representation of bytes
(bytes, units=[' bytes','KB','MB','GB','TB', 'PB', 'EB'])
| 2 | # (c) @biisal |
| 3 | # (c) adarsh-goel |
| 4 | def human_size(bytes, units=[' bytes','KB','MB','GB','TB', 'PB', 'EB']): |
| 5 | """ Returns a human readable string representation of bytes """ |
| 6 | return str(bytes) + units[0] if int(bytes) < 1024 else human_size(int(bytes)>>10, units[1:]) |
nothing calls this directly
no outgoing calls
no test coverage detected