<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def hex(self):
 """Hexideciaml representation of the message in bytes."""

        props = self._message_properties()
        msg = bytearray([MESSAGE_START_CODE_0X02, self._code])

        for prop in props:
            # pylint: disable=unused-variable
            for key, val in prop.items():
                if val is None:
                    pass
                elif isinstance(val, int):
                    msg.append(val)
                elif isinstance(val, Address):
                    if val.addr is None:
                        pass
                    else:
                        msg.extend(val.bytes)
                elif isinstance(val, MessageFlags):
                    msg.extend(val.bytes)
                elif isinstance(val, bytearray):
                    msg.extend(val)
                elif isinstance(val, bytes):
                    msg.extend(val)
                elif isinstance(val, Userdata):
                    msg.extend(val.bytes)

        return binascii.hexlify(msg).decode()