def SizeToReadableString(filesize):
  """Turn a filesize int into a human readable filesize.

  From http://stackoverflow.com/questions/1094841/

  Args:
    filesize: int
  Returns:
    string: human readable size representation.
  """
  for x in ["bytes", "KiB", "MiB", "GiB", "TiB"]:
    if filesize < 1000.0:
      return "%3.1f %s" % (filesize, x)
    filesize /= 1000.0