def to_memory_units(memory_bytes, round_up):
    'Convert from bytes -> memory units.'
    value = (memory_bytes / MEMORY_RESOURCE_UNIT_BYTES)
    if (value < 1):
        raise ValueError('The minimum amount of memory that can be requested is {} bytes, however {} bytes was asked.'.format(MEMORY_RESOURCE_UNIT_BYTES, memory_bytes))
    if (isinstance(value, float) and (not value.is_integer())):
        if round_up:
            value = int(math.ceil(value))
        else:
            value = int(math.floor(value))
    return int(value)
Convert from bytes -> memory units.
def to_memory_units(memory_bytes, round_up):
    
    value = (memory_bytes / MEMORY_RESOURCE_UNIT_BYTES)
    if (value < 1):
        raise ValueError('The minimum amount of memory that can be requested is {} bytes, however {} bytes was asked.'.format(MEMORY_RESOURCE_UNIT_BYTES, memory_bytes))
    if (isinstance(value, float) and (not value.is_integer())):
        if round_up:
            value = int(math.ceil(value))
        else:
            value = int(math.floor(value))
    return int(value)