code: def aggregate_raw_batches(self, pipeline, **kwargs):
          
          # OP_MSG with document stream returns is required to support
          # sessions.
          if "session" in kwargs:
              raise ConfigurationError(
                  "aggregate_raw_batches does not support sessions")
          return self._aggregate(pipeline, RawBatchCommandCursor, 0,
                                 None, False, **kwargs)
docs: Perform an aggregation and retrieve batches of raw BSON.
  
          Similar to the :meth:`aggregate` method but returns a
          :class:`~pymongo.cursor.RawBatchCursor`.
  
          This example demonstrates how to work with raw batches, but in practice
          raw batches should be passed to an external library that can decode
          BSON into another data type, rather than used with PyMongo's
          :mod:`bson` module.
  
            >>> import bson
            >>> cursor = db.test.aggregate_raw_batches([
            ...     {'$project': {'x': {'$multiply': [2, '$x']}}}])
            >>> for batch in cursor:
            ...     print(bson.decode_all(batch))
  
          .. note:: aggregate_raw_batches does not support sessions.
  
          .. versionadded:: 3.6