Generate MappedRanges for all mapped ranges.

		Yields:
			MappedRange
422713
def ranges(self, start=None, stop=None):
		
		_check_start_stop(start, stop)
		start_loc = self._bisect_right(start)
		if stop is None:
			stop_loc = len(self._keys)
		else:
			stop_loc = self._bisect_left(stop)
		start_val = self._values[start_loc - 1]
		candidate_keys = [start] + self._keys[start_loc:stop_loc] + [stop]
		candidate_values = [start_val] + self._values[start_loc:stop_loc]
		for i, value in enumerate(candidate_values):
			if value is not NOT_SET:
				start_key = candidate_keys[i]
				stop_key = candidate_keys[i + 1]
				yield MappedRange(start_key, stop_key, value)
520899
function generateFunctionMappingsArray(ast: Ast): $ReadOnlyArray<RangeMapping> {
  const mappings = [];
  forEachMapping(ast, mapping => {
    mappings.push(mapping);
  });
  return mappings;
}
1011940
def range(self, *args):
        
        args = list(args)
        args.insert(0, self.obj)
        return self._wrap(range(*args))
1169816
function RangeIterator(range) {
	this.range = range;
	if (range.collapsed)
		return;

//[TODO] ensure this works
	// get anchors
	var root = range.commonAncestorContainer;
	this._next = range.startContainer == root && !DOMUtils.isDataNode(range.startContainer) ?
	    range.startContainer.childNodes[range.startOffset] :
	    DOMUtils.findClosestAncestor(root, range.startContainer);
	this._end = range.endContainer == root && !DOMUtils.isDataNode(range.endContainer) ?
	    range.endContainer.childNodes[range.endOffset] :
	    DOMUtils.findClosestAncestor(root, range.endContainer).nextSibling;
}
1354111
def gridrange(start, end, step):
    """"""
    for x in frange(start.real, end.real, step.real):
        for y in frange(start.imag, end.imag, step.imag):
            yield x + y * 1j
250090
def grid_range(range)
      return nil if range.nil?
      Array(range).flatten.map do |pos|
        pos.respond_to?(:to_a) ? pos.to_a : pos
      end.flatten.uniq
    end
102688
def genrows(cursor: Cursor, arraysize: int = 1000) \
        -> Generator[List[Any], None, None]:
    
    # http://code.activestate.com/recipes/137270-use-generators-for-fetching-large-db-record-sets/  # noqa
    while True:
        results = cursor.fetchmany(arraysize)
        if not results:
            break
        for result in results:
            yield result
999725
static SortedRangeSet copyOf(Type type, Iterable<Range> ranges)
    {
        return new Builder(type).addAll(ranges).build();
    }
276803
def generate_numeric_range(items, lower_bound, upper_bound):
    

    quantile_grid = create_quantiles(items, lower_bound, upper_bound)
    labels, bounds = (zip(*quantile_grid))
    ranges = ((label, NumericRange(*bound))
              for label, bound in zip(labels, bounds))
    return ranges
101158
def get_ranges(self, element, key):
        
        keys = self.p['keys']
        ranges = self.p['ranges']

        if ranges == {}:
            return {d.name: element.range(d.name, self.data_range)
                    for d in element.dimensions()}
        if keys is None:
            specs = ranges
        elif keys and not isinstance(ranges, list):
            raise ValueError("Key list specified but ranges parameter"
                             " not specified as a list.")
        elif len(keys) == len(ranges):
            # Unpack any 1-tuple keys
            try:
                index = keys.index(key)
                specs = ranges[index]
            except:
                raise KeyError("Could not match element key to defined keys")
        else:
            raise ValueError("Key list length must match length of supplied ranges")

        return match_spec(element, specs)
523376
def genslices(n):
    """"""
    def range_with_none():
        yield None
        yield from range(-n, n+1)

    for t in product(range_with_none(), range_with_none(), range_with_none()):
        s = slice(*t)
        if s.step != 0:
            yield s
473033
def range(self, start='-', stop='+', count=None):
        
        return self.database.xrange(self.key, start, stop, count)
921720
def _apply_ranges(self, pat, hosts):
         

        (loose_pattern, limits) = self._enumeration_info(pat)
        if not limits:
            return hosts

        (left, right) = limits
        enumerated = enumerate(hosts)
        if left == '':
            left = 0
        if right == '':
            right = 0
        left=int(left)
        right=int(right)
        enumerated = [ h for (i,h) in enumerated if i>=left and i<=right ]
        return enumerated
327926
public static List<Long> starts(final Iterable<Range<Long>> ranges) {
        List<Long> starts = new ArrayList<Long>();
        for (Range<Long> range : ranges) {
            checkClosedOpen(range);
            starts.add(range.lowerEndpoint());
        }
        return starts;
    }
432057
def iteritems(self):
        
        for m in self.mappings:
            yield self.indexes[m.clause][m.target], m
1371082
def sample_range(range, seed=nil)
      srand seed if seed
      rand * (range.end - range.begin) + range.begin
    end
914715
public static <T extends Comparable<T>> RangeSet<T> unionRangeSets(final Iterable<RangeSet<T>> rangeSets)
  {
    final RangeSet<T> rangeSet = TreeRangeSet.create();
    for (RangeSet<T> set : rangeSets) {
      rangeSet.addAll(set);
    }
    return rangeSet;
  }