<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_key_value(self, key, value):
 """Add custom field to Indicator object. .. note:: The key must be the exact name required by the batch schema. Example:: file_hash = tcex.batch.file('File', '1d878cdc391461e392678ba3fc9f6f32') file_hash.add_key_value('size', '1024') Args: key (str):
 The field key to add to the JSON batch data. value (str):
 The field value to add to the JSON batch data. """

        key = self._metadata_map.get(key, key)
        if key in ['dateAdded', 'lastModified']:
            self._indicator_data[key] = self._utils.format_datetime(
                value, date_format='%Y-%m-%dT%H:%M:%SZ'
            )
        elif key == 'confidence':
            self._indicator_data[key] = int(value)
        elif key == 'rating':
            self._indicator_data[key] = float(value)
        else:
            self._indicator_data[key] = value