(input)
| 383 | return ticks |
| 384 | |
| 385 | def to_friendly_bytes(input): |
| 386 | if not input: |
| 387 | return input |
| 388 | input = "{0}".format(input) |
| 389 | |
| 390 | formats = { |
| 391 | r"^[0-9]+B$" : 'B', |
| 392 | r"^[0-9]+K$" : 'KB', |
| 393 | r"^[0-9]+M$" : 'MB', |
| 394 | r"^[0-9]+G$" : 'GB' |
| 395 | } |
| 396 | |
| 397 | for pattern, friendly_size in formats.items(): |
| 398 | if re.match(pattern, input): |
| 399 | return "{0} {1}".format(input[ : -1].strip(), friendly_size) |
| 400 | |
| 401 | return input |
| 402 | |
| 403 | def _parse_cpu_string(cpu_string): |
| 404 | # Get location of fields at end of string |
no outgoing calls
no test coverage detected
searching dependent graphs…