Returns an iterator over the readable regions for this process.
961050
def Regions(self,
              skip_mapped_files=False,
              skip_shared_regions=False,
              skip_executable_regions=False,
              skip_readonly_regions=False):
    """"""
    try:
      maps_file = open("/proc/" + str(self.pid) + "/maps", "r")
    except OSError as e:
      raise process_error.ProcessError(e)

    with maps_file:
      for line in maps_file:
        m = self.maps_re.match(line)
        if not m:
          continue
        start = int(m.group(1), 16)
        end = int(m.group(2), 16)
        region_protec = m.group(3)
        inode = int(m.group(6))

        if "r" in region_protec:
          if skip_mapped_files and inode != 0:
            continue
          if skip_shared_regions and "s" in region_protec:
            continue
          if skip_executable_regions and "x" in region_protec:
            continue
          if skip_readonly_regions and "w" not in region_protec:
            continue
          yield start, end - start
475146
private Iterator<String> decodeKeys(final Iterator<Row<ByteBuffer, DeltaKey>> iter) {
        return new AbstractIterator<String>() {
            @Override
            protected String computeNext() {
                while (iter.hasNext()) {
                    Row<ByteBuffer, DeltaKey> row = iter.next();
                    if (!row.getColumns().isEmpty()) { // Ignore range ghosts
                        return AstyanaxStorage.getContentKey(row.getRawKey());
                    }
                }
                return endOfData();
            }
        };
    }
837933
@Override
    public Iterator<Path> iterator() {

        final List<String> tokens = tokenize(this);
        final int tokensSize = tokens.size();
        final List<Path> paths = new ArrayList<>(tokensSize);
        for (int i = 0; i < tokensSize; i++) {
            ArchivePath newPath = ArchivePaths.root();
            for (int j = 0; j <= i; j++) {
                newPath = ArchivePaths.create(newPath, tokens.get(j));
            }
            paths.add(new ShrinkWrapPath(newPath, this.fileSystem));
        }

        return paths.iterator();
    }
898655
public static <T> Iterator<T> getUnmodifiableIterator (Iterable<T> c)
    {
        return getUnmodifiableIterator(c.iterator());
    }
834031
public Iterator<QueryBinding> iterator() 
	{
		List<QueryBinding> iBindings = new ArrayList<QueryBinding>();
		for(QueryBindingImpl b : bindings) {
			iBindings.add(b);
		}
		return iBindings.iterator();
	}
219316
def iterator_from_slice(s):
    
    import numpy as np
    start = s.start if s.start is not None else 0
    step = s.step if s.step is not None else 1

    if s.stop is None:
        # Infinite iterator.
        return itertools.count(start=start, step=step)
    else:
        # xrange-like iterator that supports float.
        return iter(np.arange(start, s.stop, step))
1301756
public static Region[] getExcluding(Region... excludedRegions) {
    	Region[] regions = Regions.getRegions();

    	if (excludedRegions == null || excludedRegions.length == 0) {
    		return regions;
    	}
    	
    	excludedRegions = removeDuplicates(excludedRegions);
    	
    	int excludedLength = 0;
    	for (Region r : excludedRegions) {
    		if (r != null) {
    			excludedLength++;
    		}
    	}

    	int outputLength = regions.length - excludedLength;
    	if (outputLength < 1) {
    		return new Region[0];
    	}
    	
    	Region[] outputRegions = new Region[outputLength];

    	int i = 0;
    	for (Region r : regions) {
    		boolean excluded = r == null || contains(excludedRegions, r);  		
    		if (!excluded) {
    			outputRegions[i] = r;
    			i++;
    		}
    	}
    	
    	return outputRegions;
    }
247273
def iter_members(self):
        
        if self.everything:
            raise ValueError("Can not iterate everything")
        for coord in sorted(self.elements):
            yield coord
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);
  }
966508
@Override
	public Iterator<C> iterator() {
		final List<Sequence<C>> localSequences = sequences;
		return new Iterator<C>() {

			private Iterator<C> currentSequenceIterator = null;
			private int currentPosition = 0;


			@Override
			public boolean hasNext() {
				//If the current iterator is null then see if the Sequences object has anything
				if (currentSequenceIterator == null) {
					return !localSequences.isEmpty();
				}

				//See if we had any compounds
				boolean hasNext = currentSequenceIterator.hasNext();
				if (!hasNext) {
					hasNext = currentPosition < sequences.size();
				}
				return hasNext;
			}


			@Override
			public C next() {
				if (currentSequenceIterator == null) {
					if (localSequences.isEmpty()) {
						throw new NoSuchElementException("No sequences to iterate over; make sure you call hasNext() before next()");
					}
					currentSequenceIterator = localSequences.get(currentPosition).iterator();
					currentPosition++;
				}
				if (!currentSequenceIterator.hasNext()) {
					currentSequenceIterator = localSequences.get(currentPosition).iterator();
					currentPosition++;
				}
				return currentSequenceIterator.next();
			}


			@Override
			public void remove() throws UnsupportedOperationException {
				throw new UnsupportedOperationException("Cannot remove from this Sequence");
			}
		};
	}
1373189
public Iterable<Record> values() {
        return () -> new Iterator<Record>(){
            private final Iterator<Record> it = data.records.values().iterator();

            /** {@inheritDoc} */
            @Override
            public boolean hasNext() {
                return it.hasNext();
            }

            /** {@inheritDoc} */
            @Override
            public Record next() {
                return it.next();
            }

            /** {@inheritDoc} */
            @Override
            public void remove() {
                throw new UnsupportedOperationException("This is a read-only iterator, remove operation is not supported.");
            }
        };
    }
188869
public Iterator<E> iterator() {

        return new Iterator<E>() {

            public boolean hasNext() {
                return enumeration.hasMoreElements();
            }

            public E next() {
                return enumeration.nextElement();
            }

            public void remove() {
                throw new UnsupportedOperationException("IterableEnumeration does not support remove");
            }
        };
    }
958214
public Iterator<InternalRow> rowIterator() {
    final int maxRows = numRows;
    final MutableColumnarRow row = new MutableColumnarRow(columns);
    return new Iterator<InternalRow>() {
      int rowId = 0;

      @Override
      public boolean hasNext() {
        return rowId < maxRows;
      }

      @Override
      public InternalRow next() {
        if (rowId >= maxRows) {
          throw new NoSuchElementException();
        }
        row.rowId = rowId++;
        return row;
      }

      @Override
      public void remove() {
        throw new UnsupportedOperationException();
      }
    };
  }
484211
public Iterator<List<HasWord>> iterator() {
    try {
      if (inputReader == null)
        inputReader = getReaderFromPath(inputPath);

      //TODO: Add new document types here
      if (docType == DocType.Plain) {
        return new PlainTextIterator();
      } else if (docType == DocType.XML) {
        return new XMLIterator();
      }

    } catch (IOException e) {
      System.err.printf("%s: Could not open path %s\n", this.getClass().getName(), inputPath);
    }

    return new Iterator<List<HasWord>>() {
      public boolean hasNext() { return false; }
      public List<HasWord> next() { throw new NoSuchElementException(); }
      public void remove() {}
    };
  }
687625
@Override
    public final Iterator<T> iterator() {
        synchronized (this.state) {
            checkState();
            this.state.available = false;
            final Iterator<T> iterator;
            try {
                iterator = new CheckedIterator<T>(doIterator(), this);
            } catch (final Throwable ex) {
                throw Throwables.propagate(ex);
            }
            this.state.activeIterator = iterator;
            return iterator;
        }
    }
615294
def chunks(self):
        
        if not hasattr(self, '_it'):
            class ChunkIterator(object):
                def __iter__(iter):
                    return iter

                def __next__(iter):
                    try:
                        chunk = self._next_chunk()
                    except StopIteration:
                        if self.loop:
                            self._init_stretching()
                            return iter.__next__()

                        raise

                    return chunk
                next = __next__

            self._it = ChunkIterator()

        return self._it
584828
def get_region (self, rs,cs, re,ce):
        '''
        '''

        rs = constrain (rs, 1, self.rows)
        re = constrain (re, 1, self.rows)
        cs = constrain (cs, 1, self.cols)
        ce = constrain (ce, 1, self.cols)
        if rs > re:
            rs, re = re, rs
        if cs > ce:
            cs, ce = ce, cs
        sc = []
        for r in range (rs, re+1):
            line = u''
            for c in range (cs, ce + 1):
                ch = self.get_abs (r,c)
                line = line + ch
            sc.append (line)
        return sc