def to_bitarray(data, width=<NUM_LIT:8>):
if isinstance(data, list) or isinstance(data, bytearray):<EOL><INDENT>data = combine_hex(data)<EOL><DEDENT>return [True if digit == '<STR_LIT:1>' else False for digit in bin(data)[<NUM_LIT:2>:].zfill(width)]<EOL>
Convert data (list of integers, bytearray or integer) to bitarray