<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def attribute( self, attr_type, attr_value, displayed=False, source=None, unique=True, formatter=None ):
 """Return instance of Attribute unique: * False - Attribute type:value can be duplicated. * Type - Attribute type has to be unique (e.g., only 1 Description Attribute). * True - Attribute type:value combo must be unique. Args: attr_type (str):
 The ThreatConnect defined attribute type. attr_value (str):
 The value for this attribute. displayed (bool, default:false):
 If True the supported attribute will be marked for display. source (str, optional):
 The source value for this attribute. unique (bool|string, optional):
 Control attribute creation. formatter (method, optional):
 A method that takes a single attribute value and returns a single formatted value. Returns: obj: An instance of Attribute. """

        attr = Attribute(attr_type, attr_value, displayed, source, formatter)
        if unique == 'Type':
            for attribute_data in self._attributes:
                if attribute_data.type == attr_type:
                    attr = attribute_data
                    break
            else:
                self._attributes.append(attr)
        elif unique is True:
            for attribute_data in self._attributes:
                if attribute_data.type == attr_type and attribute_data.value == attr.value:
                    attr = attribute_data
                    break
            else:
                self._attributes.append(attr)
        elif unique is False:
            self._attributes.append(attr)
        return attr