<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _canceller_for(self, elts, event):
 """Obtains a cancellation function that removes elts. The returned cancellation function returns ``True`` if all elements was removed successfully from the _in_deque, and false if it was not. """

        def canceller():
            """Cancels submission of ``elts`` as part of this bundle.

            Returns:
               bool: ``False`` if any of elements had already been sent,
               otherwise ``True``.
            """
            try:
                self._event_deque.remove(event)
                self._in_deque.remove(elts)
                return True
            except ValueError:
                return False

        return canceller