def determine_collections(self):
for value in record_get_field_values(self.record, '<STR_LIT>', code='<STR_LIT:a>'):<EOL><INDENT>if '<STR_LIT>' in value.upper():<EOL><INDENT>self.collections.add('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' in value.upper():<EOL><INDENT>self.collections.add('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' in value.upper():<EOL><INDENT>self.collections.add('<STR_LIT>')<EOL><DEDENT>if "<STR_LIT>" in value.upper():<EOL><INDENT>self.hidden = True<EOL><DEDENT><DEDENT>if self.is_published():<EOL><INDENT>self.collections.add("<STR_LIT>")<EOL>self.collections.add("<STR_LIT>")<EOL><DEDENT>if '<STR_LIT>' not in self.collections:<EOL><INDENT>from itertools import product<EOL>kb = ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>']<EOL>values = record_get_field_values(self.record, "<STR_LIT>", code='<STR_LIT:a>')<EOL>for val, rep in product(values, kb):<EOL><INDENT>if val.startswith(rep):<EOL><INDENT>self.collections.add('<STR_LIT>')<EOL>break<EOL><DEDENT><DEDENT><DEDENT>if record_get_field_values(self.record, '<STR_LIT>',<EOL>filter_subfield_code="<STR_LIT:a>",<EOL>filter_subfield_value="<STR_LIT>"):<EOL><INDENT>self.collections.add("<STR_LIT>")<EOL><DEDENT>self.collections.add('<STR_LIT>')<EOL>self.collections.add('<STR_LIT>')<EOL>if '<STR_LIT>' not in self.collections:<EOL><INDENT>for value in record_get_field_values(self.record,<EOL>tag='<STR_LIT>',<EOL>code='<STR_LIT:n>'):<EOL><INDENT>if value[-<NUM_LIT:2>:].isdigit():<EOL><INDENT>self.collections.add('<STR_LIT>')<EOL>break<EOL><DEDENT><DEDENT><DEDENT>record_delete_fields(self.record, "<STR_LIT>")<EOL>
Try to determine which collections this record should belong to.