code: def are_all_matches_terminal(self,
              predicate: Callable[[ops.Operation], bool]):
          
          return all(
              self.next_moment_operating_on(op.qubits, i + 1) is None for
              (i, op) in self.findall_operations(predicate)
          )
docs: Check whether all of the ops that satisfy a predicate are terminal.
  
          Args:
              predicate: A predicate on ops.Operations which is being checked.
  
          Returns:
              Whether or not all `Operation` s in a circuit that satisfy the
              given predicate are terminal.