maybe a bit more details about the records you're trying to compare would actually help. Seems that you're trying to see if primer_record.primer_processed_seq is in either record.processed_seq or record.reverse_seq.
what are primer_record.primer_processed_seq , record.processed_seq and record.reverse_seq ? (strings, integers, list, etc... ???) --

