def _num_bytes_to_human_readable(num_bytes):
  """Returns human readable string of how much memory `num_bytes` fills."""
  if num_bytes < (2 ** 10):
    return "%d B" % num_bytes
  elif num_bytes < (2 ** 20):
    return "%.3f KB" % (float(num_bytes) / (2 ** 10))
  elif num_bytes < (2 ** 30):
    return "%.3f MB" % (float(num_bytes) / (2 ** 20))
  else:
    return "%.3f GB" % (float(num_bytes) / (2 ** 30))
def _num_bytes_to_human_readable ( num_bytes ) : if num_bytes < ( 2 ** 10 ) : return "%d B" % num_bytes elif num_bytes < ( 2 ** 20 ) : return "%.3f KB" % ( float ( num_bytes ) / ( 2 ** 10 ) ) elif num_bytes < ( 2 ** 30 ) : return "%.3f MB" % ( float ( num_bytes ) / ( 2 ** 20 ) ) else : return "%.3f GB" % ( float ( num_bytes ) / ( 2 ** 30 ) )
Returns human readable string of how much memory `num_bytes` fills.