<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def write(variable, value):
 """ write an element to LiFePO4wered. :param variable: the element. :type variable: Lifepo4weredEnum :param int value: the value to write. :return: the written value :rtype: int :raises ValueError: if variable parameter is not a member of Lifepo4weredEnum :raises ValueError: if value is not an int type """

    if variable not in variablesEnum:
        raise ValueError('Use a lifepo4wered enum element as write element.')
    
    if isinstance(value, int) is False:
        raise TypeError('Use a int as value.')

    if canWrite(variable):
        return lifepo4weredSO.write_lifepo4wered(variable.value, value)
    else:
        raise RuntimeError('You cannot write {0} value, just read it'.format(variable.name))