<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def append(self, future):
 """Append a future to the queue."""

        if future._ended() and future.index is None:
            self.inprogress.add(future)
        elif future._ended() and future.index is not None:
            self.ready.append(future)
        elif future.greenlet is not None:
            self.inprogress.add(future)
        else:
            self.movable.append(future)

            # Send the oldest future in the movable deque until under the hwm
            over_hwm = self.timelen(self.movable) > self.highwatermark
            while over_hwm and len(self.movable) > 1:
                sending_future = self.movable.popleft()
                if sending_future.id[0] != scoop.worker:
                    sending_future._delete()
                self.socket.sendFuture(sending_future)
                over_hwm = self.timelen(self.movable) > self.highwatermark