<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def format_attributes_json(self):
 """Convert the Attributes object to json format."""

        attributes_json = {}

        for key, value in self.attributes.items():
            key = utils.check_str_length(key)[0]
            value = _format_attribute_value(value)

            if value is not None:
                attributes_json[key] = value

        result = {
            'attributeMap': attributes_json
        }

        return result