def __iter__(self):
        iterable = self._iterate()

        order_by = self.get_order_by()
        if order_by:
            iterable = sorted(
                iterable, key=lambda x: x.get_sort_key(order_by))

        if self._offset is not None or self._limit is not None:
            iterable = islice(iterable, self._offset or 0,
                              (self._offset or 0) + self._limit)

        for item in iterable:
            yield item
Scales line or columns of a matrix.
dataset/ETHPy150Open lektor/lektor/lektor/db.py/Query.__iter__--crossover with--dataset/ETHPy150Open omangin/multimodal/multimodal/lib/nmf.py/_scale