def _StrMem(nbytes):
  """Converts a number (of bytes) into a human readable string (kb, mb)."""
  if nbytes < 2**10:
    return '%d B' % nbytes
  if nbytes < 2**20:
    return '%.1f KB' % round(nbytes / 1024.0)
  return '%.1f MB' % (nbytes / 1048576.0)