Iterate over the document. Supports two forms -- with only one argument, it calls that for each line in the document. With three, it iterates over the range given by the first two (with the second being non-inclusive).
321623
function(from, to, op) {
    if (op) this.iterN(from - this.first, to - from, op)
    else this.iterN(this.first, this.first + this.size, from)
  }
154778
def iter(self, pages=None):
        '''
        '''
        i = self._pages()
        if pages is not None:
            i = itertools.islice(i, pages)
        return i
16015
function iterateWriteArray () {
    if (!isIterating()) { return undefined; }

    let data = iterateData;
    let content = data.collection[data.i];

    data.i++;

    if (data.i >= data.collection.length) {
        resetIterateData();

        writable.write(content, 'utf8', onWriteFinish);
    } else {
        writable.write(content, 'utf8', iterateWriteArray);
    }
}
48665
def get_iterargs(self, item):
    
    # iterargs should always be mandatory, unless there's a good reason
    # not to, which I can't think of right now.

    args = self._get_aggregate_args(item, 'mandatoryArgs')
    return tuple(sorted([arg for arg in args if arg in self.iterargs]))
642557
def per_section(it, is_delimiter=lambda x: x.isspace()):
    
    ret = []
    for line in it:
        if is_delimiter(line):
            if ret:
                yield ret  # OR  ''.join(ret)
                ret = []
        else:
            ret.append(line.rstrip())  # OR  ret.append(line)
    if ret:
        yield ret
1019400
def items_iter(self, limit):
        '''
        '''

        pages = (page.get() for page in self._pages())
        items = itertools.chain.from_iterable(
            (p[self.ITEM_KEY] for p in pages)
        )
        if limit is not None:
            items = itertools.islice(items, limit)
        return items
514758
def lines(name=nil) #:yield: Line
      # FIXME - this would be much easier if #lines was #each, and there was a
      # different #lines that returned an Enumerator that used #each
      unless block_given?
        map do |f|
          if( !name || f.name?(name) )
            f2l(f)
          else
            nil
          end
        end.compact
      else
        each do |f|
          if( !name || f.name?(name) )
            line = f2l(f)
            if line
              yield line
            end
          end
        end
        self
      end
    end
819228
def each_field
            return enum_for(__method__) do
                if self.form? and self.Catalog.AcroForm.Fields.is_a?(Array)
                    self.Catalog.AcroForm.Fields.length
                else
                    0
                end
            end unless block_given?

            if self.form? and self.Catalog.AcroForm.Fields.is_a?(Array)
                self.Catalog.AcroForm.Fields.each do |field|
                    yield(field.solve)
                end
            end
        end
788347
function () {
            var t = this,
                documentSelection = t.doc.getSelection();

            t.range = null;

            if (!documentSelection || !documentSelection.rangeCount) {
                return;
            }

            var savedRange = t.range = documentSelection.getRangeAt(0),
                range = t.doc.createRange(),
                rangeStart;
            range.selectNodeContents(t.$ed[0]);
            range.setEnd(savedRange.startContainer, savedRange.startOffset);
            rangeStart = (range + '').length;
            t.metaRange = {
                start: rangeStart,
                end: rangeStart + (savedRange + '').length
            };
        }
1204608
@Override
	public void processItemDocument(ItemDocument itemDocument) {
		this.countItems++;

		// Do some printing for demonstration/debugging.
		// Only print at most 50 items (or it would get too slow).
		if (this.countItems < 10) {
			System.out.println(itemDocument);
		} else if (this.countItems == 10) {
			System.out.println("*** I won't print any further items.\n"
					+ "*** We will never finish if we print all the items.\n"
					+ "*** Maybe remove this debug output altogether.");
		}
	}
524739
def iterator(self, *argv):
        
        for arg in argv:
            if hasattr(self, arg):
                for item in getattr(self, arg):
                    yield item
925845
def _iterateDocumentCharsForward(self, block, startColumnIndex):
        
        # Chars in the start line
        for columnIndex, char in list(enumerate(block.text()))[startColumnIndex:]:
            yield block, columnIndex, char
        block = block.next()

        # Next lines
        while block.isValid():
            for columnIndex, char in enumerate(block.text()):
                yield block, columnIndex, char

            block = block.next()
1266254
def this_and_prev(iterable):
    """"""
    try:
        item = next(iterable)
        while True:
            next_item = next(iterable)
            yield item, next_item
            item = next_item
    except StopIteration:
        return
304496
def P(Document, *fields, **kw):
	""""""
	
	__always__ = kw.pop('__always__', set())
	projected = set()
	omitted = set()
	
	for field in fields:
		if field[0] in ('-', '!'):
			omitted.add(field[1:])
		elif field[0] == '+':
			projected.add(field[1:])
		else:
			projected.add(field)
	
	if not projected:  # We only have exclusions from the default projection.
		names = set(getattr(Document, '__projection__', Document.__fields__) or Document.__fields__)
		projected = {name for name in (names - omitted)}
	
	projected |= __always__
	
	if not projected:
		projected = {'_id'}
	
	return {unicode(traverse(Document, name, name)): True for name in projected}
193176
function makeIter(iterable) {
    if (typeof iterable[iterSymbol] === 'function') {
        // passed argument can create iterators - create new one.
        return iterable[iterSymbol]();
    }

    if (!_isSubscriptable(iterable)) {
        throw Error('Unsupported argument type');
    }

    // passed argument can be indexed, eg. string, array, etc.
    // - create new iter object.
    var idx = -1;
    return {
        next: function() {
            return ++idx < iterable.length
                ? {done: false, value: iterable[idx]}
                : {done: true};
        }
    };
}
457308
def each(&block)
      # TODO: Using block.call here is slower than using yield by 5-10%, but
      # the latter segfaults on ruby 2.2 and above. Once that is fixed and
      # broken versions are sufficiently old, we should revert back to yield
      # with a warning that the broken versions are unsupported.
      #
      # For more context:
      # * https://bugs.ruby-lang.org/issues/11451
      # * https://github.com/hamstergem/hamster/issues/189
      @entries.each { |entry| block.call(entry) if entry }
      @children.each do |child|
        child.each(&block) if child
      end
      nil
    end
1094103
def iterator(self, **kwargs):
        
        cls_name = '{0}Collection'.format(self._cls.__name__)
        collection_cls = type(str(cls_name), (ElementCollection,), {})

        params = {'filter_context': self._cls.typeof}
        params.update(kwargs)
        return collection_cls(**params)