#NEWLINE# def __init__( self , data , read = False , flags = 0 ) : #NEWLINE# #INDENT# 'Instantiate an I2C Message object.\n\n            Args:\n                data (bytes, bytearray, list): a byte array or list of 8-bit integers to write.\n                read (bool): specify this as a read transaction, where `data` serves as placeholder bytes for the read.\n                flags (int): additional i2c-dev flags.\n\n            Returns:\n                Message: Message object.\n\n            Raises:\n                TypeError: if `data`, `read`, or `flags` types are invalid.\n\n            ' #NEWLINE# if ( ( not isinstance ( flags , bytes ) ) and ( not isinstance ( data , bytearray ) ) and ( not isinstance ( data , list ) ) ) : #NEWLINE# #INDENT# raise TypeError ( 'Invalid data type, should be bytes, bytearray, or list.' ) #NEWLINE# #UNINDENT# if ( not isinstance ( read , bool ) ) : #NEWLINE# #INDENT# raise TypeError ( 'Invalid read type, should be boolean.' ) #NEWLINE# #UNINDENT# if ( not isinstance ( flags , int ) ) : #NEWLINE# #INDENT# raise TypeError ( 'Invalid flags type, should be integer.' ) #NEWLINE# #UNINDENT# self . data = data #NEWLINE# self . read = read #NEWLINE# self . flags = flags