def valid(summary, row): "Confirms if a pattern fits the given summary." return all(row[i] == v for i,v in summary)