<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def measure_put_attachment(self, key, value):
 """Associate the contextual information of an Exemplar to this MeasureMap Contextual information is represented as key - value string pairs. If this method is called multiple times with the same key, only the last value will be kept. """

        if self._attachments is None:
            self._attachments = dict()

        if key is None or not isinstance(key, str):
            raise TypeError('attachment key should not be '
                            'empty and should be a string')
        if value is None or not isinstance(value, str):
            raise TypeError('attachment value should not be '
                            'empty and should be a string')

        self._attachments[key] = value