

def batch_size(self, batch_size):
    "Limits the number of documents returned in one batch. Each batch\n        requires a round trip to the server. It can be adjusted to optimize\n        performance and limit data transfer.\n\n        .. note:: batch_size can not override MongoDB's internal limits on the\n           amount of data it will return to the client in a single batch (i.e\n           if you set batch size to 1,000,000,000, MongoDB will currently only\n           return 4-16MB of results per batch).\n\n        Raises :exc:`TypeError` if `batch_size` is not an integer.\n        Raises :exc:`ValueError` if `batch_size` is less than ``0``.\n        Raises :exc:`~pymongo.errors.InvalidOperation` if this\n        :class:`Cursor` has already been used. The last `batch_size`\n        applied to this cursor takes precedence.\n\n        :Parameters:\n          - `batch_size`: The size of each batch of results requested.\n\n        .. versionadded:: 1.9\n        "
    if (not isinstance(batch_size, (int, long))):
        raise TypeError('batch_size must be an integer')
    if (batch_size < 0):
        raise ValueError('batch_size must be >= 0')
    self.__check_okay_to_chain()
    self.__batch_size = (((batch_size == 1) and 2) or batch_size)
    return self

dataset/ETHPy150Open blynch/CloudMemeBackend/pymongo/cursor.py Cursor.batch_size/original