<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_int(code, bits_per_char=6):
 """Encode int into a string preserving order It is using 2, 4 or 6 bits per coding character (default 6). Parameters: code: int Positive integer. bits_per_char: int The number of bits per coding character. Returns: str: the encoded integer """

    if code < 0:
        raise ValueError('Only positive ints are allowed!')

    if bits_per_char == 6:
        return _encode_int64(code)
    if bits_per_char == 4:
        return _encode_int16(code)
    if bits_per_char == 2:
        return _encode_int4(code)

    raise ValueError('`bits_per_char` must be in {6, 4, 2}')