<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def create(self, id, fd, filename='attachment-name'):
 # pylint: disable=invalid-name,redefined-builtin """Add an attachment to a device. :param id: Device ID as an int. :param fd: File-like object to upload. :param filename: (optional) Name to use for new attachment as a string. :return: :class:`attachments.Attachment <attachments.Attachment>` object :rtype: attachments.Attachment """

        schema = AttachmentSchema(exclude=('id', 'created', 'updated', 'size', 'path', 'device_id'))
        resp = self.service.post(self._base(id),
                                 files={'file': (filename, fd)})
        return self.service.decode(schema, resp)