Behaves similarly to Ruby's Array#map, invoking the given block with
 each active connection object and returning a new array with the results.

 See UserManager#each for details on the current usage and limitations.
339706
def map(&block)
      collection = []

      each do |connection|
        collection << block.call(connection) if block
      end

      collection
    end
690589
def each
      return enum_for(:each) unless block_given?

      execute.each do |result|
        yield(model.new(result.merge(api: api)))
      end
    end
759321
def map_blocks(data, f, blen=None, storage=None, create='array', **kwargs):
    """"""

    # setup
    storage = _util.get_storage(storage)
    if isinstance(data, tuple):
        blen = max(_util.get_blen_array(d, blen) for d in data)
    else:
        blen = _util.get_blen_array(data, blen)
    if isinstance(data, tuple):
        _util.check_equal_length(*data)
        length = len(data[0])
    else:
        length = len(data)

    # block-wise iteration
    out = None
    for i in range(0, length, blen):
        j = min(i+blen, length)

        # obtain blocks
        if isinstance(data, tuple):
            blocks = [d[i:j] for d in data]
        else:
            blocks = [data[i:j]]

        # map
        res = f(*blocks)

        # store
        if out is None:
            out = getattr(storage, create)(res, expectedlen=length, **kwargs)
        else:
            out.append(res)

    return out
426221
def auto_paging_each(&blk)
      return enum_for(:auto_paging_each) unless block_given?

      page = self
      loop do
        page.each(&blk)
        page = page.next_page
        break if page.empty?
      end
    end
376811
def each(&block)
      items = self.next.to_h['items']

      until items.empty?
        items.each(&block)
        items = self.next.to_h['items']
      end
    end
1057406
def each(&block)
      return @results.each(&block) if @results
      @results = []
      cur_v_i = Array.new(@data.keys.length, 0)
      keys = @data.keys.sort_by(&:to_s)
      result = {}
      keys.each do |key|
        result[key] = @data[key][0]
      end
      while true
        r = result.dup
        @results << r
        block.call(r) if block
        keys.each_with_index do |k, k_i|
          v_i = ((cur_v_i[k_i] = (1 + cur_v_i[k_i]) % @data[k].length))
          result[k] = @data[k][v_i]
          if v_i > 0 # Found next ?
            break
          elsif k_i == keys.length - 1 # Last?
            return
          end
        end
      end
      @results
    end
1125628
def fetch_block(block_size=nil)
      block_size ||= @block_size ||= @options.fetch(:block_size) { 1000 }
      @result = @connection.execute("fetch #{block_size} from cursor_#{@cursor}")

      if @iterate == :each_array
        @block = @result.each_row.collect {|row| row }
      else
        @block = @result.collect {|row| row }
      end
    end
1136201
def each
      return to_enum unless block_given?
      super do |resource|
        begin
          original, resource.collection = resource.collection, self
          yield resource
        ensure
          resource.collection = original
        end
      end
    end
64199
public static void foreach(String path, Consumer<? super String> block) {
    Ruby.Enumerator.of(new EachLineIterable(new File(path))).each(block);
  }
1150718
def output_mapping
      @output_mapping ||= (
        hash = {}
        case output
        when Array
          output.each do |path|
            hash[path] = format(path)
          end
        when String
          hash[output] = format(output)
        when Hash
          hash = output
        end
        hash
      )
    end
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
283589
function each(object, func, thisp) {
	return Object.keys(object).map(key => {
		return func.call(thisp, key, object[key]);
	});
}
1056999
def many_with_map?(clause, mesg=nil, &block) # :yields: argument
      map_mesg = ( mesg.nil? ? "" : " after map #{mesg}" )
      many_with_map = clause("many of #{clause.inspect}#{map_mesg}") do |o|
        o.map(&block).all? { |p| clause === p }
      end
      all? Enumerable, many_with_map
    end
898687
def count(&block)
      return keys.count unless block_given?
      proxy = HashProxy.new
      keys.inject(0) do |count, key|
        proxy.with(mapper[key], &block) ? count.succ : count
      end
    end
1119353
def each
      @data.each do |section, hash|
        hash.each do |key, value|
          yield [section, key, value]
        end
      end
    end
971241
def concurrent_map
      threads = services.map{|s| Thread.new{ yield s } }
      threads.each(&:join)
      threads.map(&:value)
    end
1208714
def each(&block)
      templates = Hash.new

      valid_paths(env.template_path).each do |template_dir|

        env.logger.debug("[Template] Searching #{template_dir} for templates")

        subdirs = Dir.glob("#{template_dir}/*")
        subdirs.each do |sub|
          if File.directory?("#{sub}")
            name = sub.sub(/#{template_dir}\//, '')
            template = Veewee::Template.new(name, sub, @env)
            if template.exists?
              env.logger.debug("[Template] template '#{name}' found")
              templates[name] = template
            end
          end
        end
      end

      if templates.length == 0
        env.logger.debug("[Template] no templates found")
      end

      Hash[templates.sort].each(&block)
    end