<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def gen_encode(data):
        "A generator for unsynchronizing a byte iterable."
        sync = False
        for b in data:
            if sync and (b == 0x00 or b & 0xE0):
                yield 0x00 # Insert sync char
            yield b
            sync = (b == 0xFF)
        if sync:
            yield 0x00