<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(self, key, value):
 """ Creates a space separated string of attributes. Mostly for the "class" attribute. """

        if key.endswith('_'):
            key = key[:-1]
        if key in self.attributes:
            self.attributes[key] = self.attributes[key] + ' ' + value
        else:
            self.attributes[key] = value