<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def encode_max_apdu_length_accepted(arg):
 """Return the encoding of the highest encodable value less than the value of the arg."""

    for i in range(5, -1, -1):
        if (arg >= _max_apdu_length_encoding[i]):
            return i

    raise ValueError("invalid max APDU length accepted: %r" % (arg,))