code: def to_bitarray(data, width=8):
      ''' Convert data (list of integers, bytearray or integer) to bitarray '''
      if isinstance(data, list) or isinstance(data, bytearray):
          data = combine_hex(data)
      return [True if digit == '1' else False for digit in bin(data)[2:].zfill(width)f to_bitarray(data, width=8):
      ''' Convert data (list of integers, bytearray or integer) to bitarray '''
      if isinstance(data, list) or isinstance(data, bytearray):
          data = combine_hex(data)
      return [True if digit == '1' else False for digit in bin(data)[2:].zfill(width)]
docs: Convert data (list of integers, bytearray or integer) to bitarray