code: def create(self, id, fd, filename='attachment-name'): # pylint: disable=invalid-name,redefined-builtin
          
          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)
docs: 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