Iterate each of the Region cols in this region
191254
def iter_cols(self, start=None, end=None):
        """"""
        start = start or 0
        end = end or self.ncols
        for i in range(start, end):
            yield self.iloc[:, i]
1020213
function buildValueColumns(
  item,
  loadedDimensions,
  columnCombinations,
  dataSets
) {
  var thisColumnOptions = clone(item._columnOptions);
  thisColumnOptions.tableStructure = item._tableStructure;
  var columns = [];
  var hasNoConcepts = item._concepts.length === 0;
  var regionDimension = getDimensionById(
    loadedDimensions,
    item.regionDimensionId
  );
  var regionDimensionIndex = getDimensionIndexById(
    loadedDimensions,
    item.regionDimensionId
  );
  var timePeriodDimension = getDimensionById(
    loadedDimensions,
    item.timePeriodDimensionId
  );
  var timePeriodDimensionIndex = getDimensionIndexById(
    loadedDimensions,
    item.timePeriodDimensionId
  );

  var regionCount = defined(regionDimension)
    ? regionDimension.values.length
    : 1;
  var timePeriodCount = defined(timePeriodDimension)
    ? timePeriodDimension.values.length
    : 1;

  for (
    var combinationIndex = 0;
    combinationIndex < columnCombinations.ids.length;
    combinationIndex++
  ) {
    var ids = columnCombinations.ids[combinationIndex];
    var dimensionIndices = mapDimensionValueIdsToKeyValues(
      item,
      loadedDimensions,
      ids
    );
    // The name is just the joined names of all the columns involved, or 'value' if no columns still have names.
    var combinationName =
      columnCombinations.names[combinationIndex]
        .filter(function(name) {
          return !!name;
        })
        .join(" ") || "Value";
    var combinationId = ids.join(" ") || "Value";
    var values = [];
    for (
      var timePeriodIndex = 0;
      timePeriodIndex < timePeriodCount;
      timePeriodIndex++
    ) {
      for (var regionIndex = 0; regionIndex < regionCount; regionIndex++) {
        if (defined(regionDimensionIndex)) {
          dimensionIndices[regionDimensionIndex] =
            regionDimension.values[regionIndex].id;
        }
        if (defined(timePeriodDimensionIndex)) {
          dimensionIndices[timePeriodDimensionIndex] =
            timePeriodDimension.values[timePeriodIndex].id;
        }
        values.push(
          getObsValue(item, loadedDimensions, dimensionIndices, dataSets)
        );
      }
    }
    thisColumnOptions.id = combinationId; // So we can refer to the dimension in a template by a sequence of ids or names.
    var column = new TableColumn(combinationName, values, thisColumnOptions);
    if (hasNoConcepts) {
      // If there are no concepts displayed to the user, there is only one value column, and we won't add a "total" column.
      // So make this column active.
      column.isActive = true;
    }
    columns.push(column);
  }
  return columns;
}
500029
def get_all_regions_with_tiles(self):
        
        for key in self.get_all_keys():
            (layer, rx, ry) = struct.unpack('>BHH', key)
            if layer == 1:
                yield (rx, ry)
1070599
private List iterateAndReturn(ResultSet rSet) {
        Iterator<Row> rowIter = rSet.iterator();
        List results = new ArrayList();

        while (rowIter.hasNext()) {
            Row row = rowIter.next();
            ColumnDefinitions columnDefs = row.getColumnDefinitions();
            Iterator<Definition> columnDefIter = columnDefs.iterator();
            Map rowData = new HashMap();
            while (columnDefIter.hasNext()) {
                Definition columnDef = columnDefIter.next();
                rowData.put(columnDef.getName(), DSClientUtilities.assign(row, null, null,
                    columnDef.getType().getName(), null, columnDef.getName(), null, null));
            }
            results.add(rowData);
        }
        return results;
    }
6925
def format(self, **kwargs):
        """"""
        attrs = self._attrs.copy()
        attrs.update(kwargs)
        return Region(self._geojson, **attrs)
616032
def _iterateDocumentCharsForward(self, block, startColumnIndex):
        
        # Chars in the start line
        endTime = time.time() + self._MAX_SEARCH_TIME_SEC
        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

            if time.time() > endTime:
                raise _TimeoutException('Time is over')

            block = block.next()
356459
def visualRegionForSelection(self, selection):
        
        region = QtGui.QRegion()
        for index in selection.indexes():
            region = region.united(self._rects[index.row()][index.column()])

        return region
534182
function eachFormElement() {
      var cb = this
        , e, i, j
        , serializeSubtags = function(e, tags) {
          for (var i = 0; i < tags.length; i++) {
            var fa = e[byTag](tags[i])
            for (j = 0; j < fa.length; j++) serial(fa[j], cb)
          }
        }
  
      for (i = 0; i < arguments.length; i++) {
        e = arguments[i]
        if (/input|select|textarea/i.test(e.tagName)) serial(e, cb)
        serializeSubtags(e, [ 'input', 'select', 'textarea' ])
      }
    }
71009
def _parse_region(self, rec, line_iter):
        
        had_info = False
        keyvals, section = self._parse_keyvals(line_iter)

        if keyvals:
            rec.metadata = keyvals[0]
        while section and section[0] != "STUDY":
            had_info = True
            keyvals, next_section = self._parse_keyvals(line_iter)
            attr_name = self._sections[section[0]]
            if attr_name in self._nolist:
                try:
                    keyvals = keyvals[0]
                except IndexError:
                    keyvals = {}

            setattr(rec, attr_name, keyvals)
            section = next_section
        return rec, had_info
869666
@Override
    public Iterator iterate()
    {
        EntityMetadata m = getEntityMetadata();
        Client client = persistenceDelegeator.getClient(m);
        boolean useLuceneOrES = !MetadataUtils.useSecondryIndex(((ClientBase) client).getClientMetadata());
        QueryTranslator translator = new QueryTranslator();
        translator.translate(getKunderaQuery(), m, useLuceneOrES);
        if (useLuceneOrES && translator.isWhereOrAggregationQuery())
        {
            throw new UnsupportedOperationException("Scrolling over hbase is unsupported for lucene or ES queries");
        }
        List<Map<String, Object>> columns = translator.getColumnsToOutput(m, getKunderaQuery(), useLuceneOrES);
        return new ResultIterator((HBaseClient) client, m, persistenceDelegeator,
                getFetchSize() != null ? getFetchSize() : this.maxResult, translator, columns);
    }
538613
def map_each(unit, options = {}, &block)
      iterate(unit, options.merge(:map_result => true), &block)
    end
1170281
def iterate(self, index, step, n_cols=70):
        

        while True:
            if step < 0 and index < 0:
                # Hack to prevent displaying a submission's post if iterating
                # comments in the negative direction
                break
            try:
                yield self.get(index, n_cols=n_cols)
            except IndexError:
                break
            index += step
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
622914
def collate(*iterables, **kwargs):
    
    key = kwargs.pop('key', lambda a: a)
    reverse = kwargs.pop('reverse', False)
    min_or_max = max if reverse else min

    rows = [iter(iterable) for iterable in iterables if iterable]
    next_values = {}
    by_key = []

    def gather_next_value(row, index):
        try:
            next_value = next(row)
        except StopIteration:
            pass
        else:
            next_values[index] = next_value
            by_key.append((key(next_value), index))

    for index, row in enumerate(rows):
        gather_next_value(row, index)

    while by_key:
        key_value, index = min_or_max(by_key)
        by_key.remove((key_value, index))
        next_value = next_values.pop(index)
        yield next_value
        gather_next_value(rows[index], index)
1299094
def make_multi_cols(self, num_class, name):
        ''''''
        cols = ['c' + str(i) + '_' for i in xrange(num_class)]
        cols = map(lambda x: x + name, cols)
        return cols
852039
def calculate_columns(self):
        """"""

        self.cols = int(math.ceil(len(self.elements) / float(self.rows)))
238975
public static void iterate(int dimension, int n, int[] size, int[] res, int dimension2, int n2, int[] size2,
                               int[] res2, CoordinateFunction func) {
        if (dimension >= n || dimension2 >= n2) {
            // stop clause
            func.process(ArrayUtil.toLongArray(res), ArrayUtil.toLongArray(res2));
            return;
        }

        if (size2.length != size.length) {
            if (dimension >= size.length)
                return;
            for (int i = 0; i < size[dimension]; i++) {
                if (dimension2 >= size2.length)
                    break;
                for (int j = 0; j < size2[dimension2]; j++) {
                    res[dimension] = i;
                    res2[dimension2] = j;
                    iterate(dimension + 1, n, size, res, dimension2 + 1, n2, size2, res2, func);
                }

            }
        } else {
            if (dimension >= size.length)
                return;

            for (int i = 0; i < size[dimension]; i++) {
                for (int j = 0; j < size2[dimension2]; j++) {
                    if (dimension2 >= size2.length)
                        break;
                    res[dimension] = i;
                    res2[dimension2] = j;
                    iterate(dimension + 1, n, size, res, dimension2 + 1, n2, size2, res2, func);
                }

            }
        }
    }