def add_record(self, record_in):
if (isinstance(record_in, dict) and<EOL>'<STR_LIT:name>' in record_in and '<STR_LIT:value>' in record_in):<EOL><INDENT>record = {}<EOL>record.update(record_in)<EOL><DEDENT>else:<EOL><INDENT>record = FITSRecord(record_in)<EOL><DEDENT>key = record['<STR_LIT:name>'].upper()<EOL>key_exists = key in self._record_map<EOL>if not key_exists or key in ('<STR_LIT>', '<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>self._record_list.append(record)<EOL>index = len(self._record_list)-<NUM_LIT:1><EOL>self._index_map[key] = index<EOL><DEDENT>else:<EOL><INDENT>index = self._index_map[key]<EOL>self._record_list[index] = record<EOL><DEDENT>self._record_map[key] = record<EOL>
Add a new record.  Strip quotes from around strings.

This will over-write if the key already exists, except
for COMMENT and HISTORY fields

parameters
-----------
record:
    The record, either a dict or a header card string
    or a FITSRecord or FITSCard
convert: bool, optional
    If True, convert strings.  E.g. '3' gets
    converted to 3 and "'hello'" gets converted
    to 'hello' and 'T'/'F' to True/False. Default
    is False.