def unpack_bitstring(string):
 byte_count = len(string)
 bits = []
 for byte in range(byte_count):
  value = ord(string[byte])
  for _ in range(8):
   bits.append(((value & 1) == 1))
   value >>= 1
 return bits

def unpack_bitstring ( string ) : byte_count = len ( string ) bits = [ ] for byte in range ( byte_count ) : value = ord ( string [ byte ] ) for _ in range ( 8 ) : bits . append ( ( ( value & 1 ) == 1 ) ) value >>= 1 return bits
creates bit array out of a string .