Calls the iterator for each element of the vector in turn
196813
function(fn) {
            	var n = this.elements.length;
            	for (var i = 0; i < n; i++) {
            	    fn(this.elements[i], i + 1);
            	}
                }
128684
function(fn) {
            	var elements = [];
            	this.each(function(x, i) {
            	    elements.push(fn(x, i));
            	});
            	return Vector.create(elements);
                }
1238977
public void setRow(int i, double value) {
        VectorIterator it = iteratorOfRow(i);

        while (it.hasNext()) {
            it.next();
            it.set(value);
        }
    }
881520
def each(offset = 0)
      return to_enum(:each, offset) unless block_given?
      @collection[offset..-1].each { |element| yield(element) }
      unless exhausted?
        offset = [@collection.size, offset].max
        fetch_next
        each(offset, &Proc.new)
      end
      self
    end
401832
public void eachInRow(int i, VectorProcedure procedure) {
        VectorIterator it = iteratorOfRow(i);

        while (it.hasNext()) {
            double x = it.next();
            int j = it.index();
            procedure.apply(j, x);
        }
    }
187406
def recursive_iter(enumerables):
    '''
    
    '''
    if not is_collection(enumerables) or isinstance(enumerables, (basestring, dict)):
        yield enumerables
    else:
        for elem in enumerables:
            for sub_elem in recursive_iter(elem):
                yield sub_elem
756669
def pairwise(iterable):
    
    iterator = iter(iterable)
    try:
        first = next(iterator)
    except StopIteration:
        return
    for element in iterator:
        yield first, element
        first = element
1093394
function iterator(filename, callback) {
    
    async.forEach(
      
        filters
      
      , function(filter, callback) {
          
          var test
            , regexp
            , matches
            
            , continuation  = filter[1]
            
            , file_path     = path.join(dir_path, filename)
            , emitter
            ;
          
          if (typeof filter[0] === 'string') {
            
            regexp = new RegExp('^' + filter[0] + '$');
            matches = regexp.exec(filename);
            
            checkAndContinue(null, matches);
            
          } else if (filter[0] instanceof RegExp) {
            
            regexp  = filter[0];
            matches = regexp.exec(filename);
            checkAndContinue(null, matches);
            
          } else {
            
            test = filter[0]
            test(filename, file_path, checkAndContinue);
            
          }
          
          function checkAndContinue(err, matches) {
            
            if (err) {
             
              callback(err);
            
            } else if (matches) {
              
              emitter = new FileEventEmitter(file_path);
              
              continuation(emitter, matches, callback);
              
            } else {
              
              callback(null);
              
            }
          
          }
        
        }
        
      , callback
    );
    
  }
524739
def iterator(self, *argv):
        
        for arg in argv:
            if hasattr(self, arg):
                for item in getattr(self, arg):
                    yield item
647921
def iterator_mix(*iterators):
    
    while True:
        one_left = False

        for it in iterators:
            try:
                yield it.next()
            except StopIteration:
                pass
            else:
                one_left = True

        if not one_left:
            break
1021221
def iterate_elements(parent):
        
        element = parent.firstChild
        while element is not None:
            yield element
            element = element.nextSibling
187878
function each(source, iterator) {
        if (source instanceof Array) {
            for (var i = 0, len = source.length; i < len; i++) {
                if (iterator(source[i], i) === false) {
                    break;
                }
            }
        }
    }
1211009
def _iterator(self, response):
        '''
        
        '''

        while True:
            result = self._parse_data(response)
            bookmark = response.get('bookmark')
            if result:
                for row in result:
                    yield row

                del result

                if not bookmark:
                    break

                response = self._call(bookmark=bookmark)

            else:
                break
512661
@Override
    public Iterator<T> iterator() {
        Iterator<T> transformed = Iterators.transform(rows.iterator(), row -> {
            T value = mapper.map(row);
            mapper.mappingComplete();
            return value;
        });
        mapper.mappingComplete();
        return transformed;
    }
1032587
def each
      return to_enum(__callee__) unless block_given?

      node = self
      loop do
        yield node
        break unless (node = node.next_node)
      end
    end
280499
public VectorIterator iteratorOfRow(int i) {
        final int ii = i;
        return new VectorIterator(columns) {
            private int j = -1;

            @Override
            public int index() {
                return j;
            }

            @Override
            public double get() {
                return Matrix.this.get(ii, j);
            }

            @Override
            public void set(double value) {
                Matrix.this.set(ii, j, value);
            }

            @Override
            public boolean hasNext() {
                return j + 1 < columns;
            }

            @Override
            public Double next() {
                if(!hasNext()) {
                    throw new NoSuchElementException();
                }
                j++;
                return get();
            }
        };
    }
216024
def flatten(iterable):
    
    try:
        iterator, sentinel, stack = iter(iterable), object(), []
    except TypeError:
        yield iterable
        return

    while True:
        value = next(iterator, sentinel)
        if value is sentinel:
            if not stack:
                break
            iterator = stack.pop()
        elif isinstance(value, str):
            yield value
        else:
            try:
                new_iterator = iter(value)
            except TypeError:
                yield value
            else:
                stack.append(iterator)
                iterator = new_iterator