def set_record(self, record, **kw):
if isstring(record):<EOL><INDENT>card = FITSCard(record)<EOL>self.update(card)<EOL>self.verify()<EOL><DEDENT>else:<EOL><INDENT>if isinstance(record, FITSRecord):<EOL><INDENT>self.update(record)<EOL><DEDENT>elif isinstance(record, dict):<EOL><INDENT>if '<STR_LIT:name>' in record and '<STR_LIT:value>' in record:<EOL><INDENT>self.update(record)<EOL><DEDENT>elif '<STR_LIT>' in record:<EOL><INDENT>self.set_record(record['<STR_LIT>'])<EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT><DEDENT>
check the record is valid and set keys in the dict

parameters
----------
record: string
    Dict representing a record or a string representing a FITS header
    card