This first cell computes the parity check matrix from the generator matrix. You need to refer to this matrix when you get a syndrome in the next cell.
The parity check matrix isn't unique. It is any matrix with the property that \(b\) is a code word if and only if \(b P\) is equal to a row of zeros. If an error occured in position \(k\) of the data, then the syndrome, \(b P\), will be row \(k\) of \(P\).
You can use this cell to compute the syndrome for any sequence of seven bits. Just replace the list of seven zeros in line 7 with whatever data you have. After you've identified the syndrome and corrected each 7-tuple, you can discard the last three bits.
Once you've corrected all four 7-tuples, combine them into a sequence of 16 bits. This code below will convert that sequence into a base 10 number. Just replace the sequence of all 1's with your sequence