<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def bytes2iec(size, compact=False):
 """ Convert a size value in bytes to its equivalent in IEC notation. See `<http://physics.nist.gov/cuu/Units/binary.html>`_. Parameters: size (int):
 Number of bytes. compact (bool):
 If ``True``, the result contains no spaces. Return: String representation of ``size``. Raises: ValueError: Negative or out of bounds value for ``size``. """

    postfn = lambda text: text.replace(' ', '') if compact else text
    if size < 0:
        raise ValueError("Negative byte size value {}".format(size))
    if size < 1024:
        return postfn('{:4d} bytes'.format(size))

    scaled = size
    for iec_unit in IEC_UNITS[1:]:
        scaled /= 1024.0
        if scaled < 1024:
            return postfn('{:6.1f} {}'.format(scaled, iec_unit))

    raise ValueError("Byte size value {} out of bounds".format(size))