<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_attribute(self, code, value):
 """Set attribute for user"""

        attr, _ = self.get_or_create(code=code)
        attr.value = value
        attr.save()