def bytes_fmt(value, precision=2):
	"""Represent bytes value in a human-readable format."""
	for units in ('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'):
		if value < 1024 or units == 'YB':
			if units != 'B' or isinstance(value, float):  # float = rate (B/s)
				value = round(value, precision)
			return '{} {}'.format(value, units)
		value /= 1024