Return an iterator that iterates through every bar in the this
        track.
495222
def get_notes(self):
        """"""
        for bar in self.bars:
            for beat, duration, notes in bar:
                yield beat, duration, notes
1035768
def bar(
    it,
    label="",
    width=32,
    hide=None,
    empty_char=BAR_EMPTY_CHAR,
    filled_char=BAR_FILLED_CHAR,
    expected_size=None,
    every=1,
):
    """"""
    count = len(it) if expected_size is None else expected_size
    with Bar(
        label=label,
        width=width,
        hide=hide,
        empty_char=BAR_EMPTY_CHAR,
        filled_char=BAR_FILLED_CHAR,
        expected_size=count,
        every=every,
    ) as bar:
        for i, item in enumerate(it):
            yield item

            bar.show(i + 1)
1113665
def next(self):
        """"""
        if not self.iter_next():
            raise StopIteration
        data = self.getdata()
        label = self.getlabel()
        # iter should stop when last batch is not complete
        if data[0].shape[0] != self.batch_size:
        # in this case, cache it for next epoch
            self._cache_data = data
            self._cache_label = label
            raise StopIteration
        return DataBatch(data=data, label=label, \
            pad=self.getpad(), index=None)
328312
def _iter_withprogress(iterable, progress, log):
    """"""
    before_all = time.time()
    before = before_all
    n = 0
    for i, o in enumerate(iterable):
        yield o
        n = i+1
        if n % progress == 0:
            after = time.time()
            log('%s rows in %.2fs; batch in %.2fs (%d rows/s)'
                % (n, after-before_all, after-before, progress/(after-before)))
            before = after
    after_all = time.time()
    log('%s rows in %.2fs (%d rows/s)'
        % (n, after_all-before_all, n/(after_all-before_all)))
256144
def iterate(self, max_iter=None):
        
        if max_iter is None:
            max_iter = np.inf

        # Calls Streamer's __enter__, which calls activate()
        with self as active_mux:
            # Main sampling loop
            n = 0

            while n < max_iter and active_mux._streamers_available():
                # Pick a stream from the active set
                idx = active_mux._next_sample_index()

                # Can we sample from it?
                try:
                    # Then yield the sample
                    yield six.advance_iterator(active_mux.streams_[idx])

                    # Increment the sample counter
                    n += 1
                    active_mux.stream_counts_[idx] += 1

                except StopIteration:
                    # Oops, this stream is exhausted.

                    # Call child-class exhausted-stream behavior
                    active_mux._on_stream_exhausted(idx)

                    # Setup a new stream for this index
                    active_mux._replace_stream(idx)
922423
def iterprogress( sized_iterable ):
    
    pb = ProgressBar( 0, len( sized_iterable ) )
    for i, value in enumerate( sized_iterable ):
        yield value
        pb.update_and_print( i, sys.stderr )
608339
public static <T> Iterator<T> iterator(Maybe<T> pub) {
        return pub.toFlowable().blockingIterable().iterator();

    }
1049263
private Iterator<D> getIterator() throws DataRecordException, IOException {
    if (Boolean.valueOf(this.workUnitState.getProp(ConfigurationKeys.SOURCE_QUERYBASED_IS_SPECIFIC_API_ACTIVE))) {
      return this.getRecordSetFromSourceApi(this.schema, this.entity, this.workUnit, this.predicateList);
    }
    return this.getRecordSet(this.schema, this.entity, this.workUnit, this.predicateList);
  }
315591
function eachFrom(keys, key, iter) {
  var i = keys.indexOf(key)
  if(!~i) return
  //start at 1 because we want to visit all keys but key.
  for(var j = 1; j < keys.length; j++)
    if(iter(keys[(j+i)%keys.length], j))
      return
}
240783
def iterator(self):
        
        if not self._result_cache:
            len(self)
        for r in self._result_cache:
            yield r
369446
public Iterator<Symbol> iterator() {
        return new Iterator<Symbol>() {

            /** The next entry to examine, or null if none. */
            private Scope.Entry nextEntry = scope.elems;

            private boolean hasNextForSure = false;

            public boolean hasNext() {
                if (hasNextForSure) {
                    return true;
                }
                while (nextEntry != null && unwanted(nextEntry.sym)) {
                    nextEntry = nextEntry.sibling;
                }
                hasNextForSure = (nextEntry != null);
                return hasNextForSure;
            }

            public Symbol next() {
                if (hasNext()) {
                    Symbol result = nextEntry.sym;
                    nextEntry = nextEntry.sibling;
                    hasNextForSure = false;
                    return result;
                } else {
                    throw new NoSuchElementException();
                }
            }

            public void remove() {
                throw new UnsupportedOperationException();
            }
        };
    }
542636
def songs_iter(self, *, page_size=250):
		

		start_token = None

		while True:
			response = self._call(
				mc_calls.TrackFeed,
				max_results=page_size,
				start_token=start_token
			)
			items = response.body.get('data', {}).get('items', [])

			if items:
				yield items

			start_token = response.body.get('nextPageToken')
			if start_token is None:
				break
421366
public static <T> Iterator<T> wrap(Iterator<T> it, String task) {
        return new ProgressBarWrappedIterator<>(it, task, -1); // indefinite progress bar
    }
1191041
def progress(iterator, enum=False, length=None):
    
    progress = ProgressBar()
    length = len(iterator) if length is None else length
    gen = enumerate(iterator)
    while True:
        i, val = next(gen)
        progress((i+1.0)/length * 100)
        if enum:
            yield i, val
        else:
            yield val
1183753
@Override
  public Iterator<Entry<String, Fetch>> iterator() {
    return Collections.unmodifiableMap(attrFetchMap).entrySet().iterator();
  }
20387
def _fromiter(it, dtype, count, progress, log):
    """"""
    if progress > 0:
        it = _iter_withprogress(it, progress, log)
    if count is not None:
        a = np.fromiter(it, dtype=dtype, count=count)
    else:
        a = np.fromiter(it, dtype=dtype)
    return a
204808
def progress(arr, options = {})
      bar = ProgressBar.new arr.length, options
      bar.show
      arr.each { |v| bar.increment yield(v) }
    end