def _get_dataset(self, spec, sort, fields, as_class, skip):
        dataset = (self._copy_only_fields(document, fields, as_class)
                   for document in self._iter_documents(spec))
        if sort:
            for sortKey, sortDirection in reversed(sort):
                dataset = iter(sorted(
                    dataset, key=lambda x: _resolve_sort_key(sortKey, x),
                    reverse=sortDirection < 0))
        for i in helpers.xrange(skip):
            try:
                next(dataset)
            except StopIteration:
                pass

        return dataset
dataset/ETHPy150Open vmalloc/mongomock/mongomock/collection.py/Collection._get_dataset/original