<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _trim_buffer_garbage(rawmessage, debug=True):
 """Remove leading bytes from a byte stream. A proper message byte stream begins with 0x02. """

    while rawmessage and rawmessage[0] != MESSAGE_START_CODE_0X02:
        if debug:
            _LOGGER.debug('Buffer content: %s', binascii.hexlify(rawmessage))
            _LOGGER.debug('Trimming leading buffer garbage')
        rawmessage = rawmessage[1:]
    return rawmessage