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

        try:
            return self.get(code=code).value
        except models.ObjectDoesNotExist:
            return default