<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _maybe_abandon(self, chunk):
 """ Determine if a chunk needs to be marked as abandoned. If it does, it marks the chunk and any other chunk belong to the same message as abandoned. """

        if chunk._abandoned:
            return True

        abandon = (
            (chunk._max_retransmits is not None and chunk._sent_count > chunk._max_retransmits) or
            (chunk._expiry is not None and chunk._expiry < time.time())
        )
        if not abandon:
            return False

        chunk_pos = self._sent_queue.index(chunk)
        for pos in range(chunk_pos, -1, -1):
            ochunk = self._sent_queue[pos]
            ochunk._abandoned = True
            ochunk._retransmit = False
            if (ochunk.flags & SCTP_DATA_FIRST_FRAG):
                break
        for pos in range(chunk_pos, len(self._sent_queue)):
            ochunk = self._sent_queue[pos]
            ochunk._abandoned = True
            ochunk._retransmit = False
            if (ochunk.flags & SCTP_DATA_LAST_FRAG):
                break

        return True