all: The method returns true if the block never returns false or nil http://stackoverflow.com/a/13249942 https://coderwall.com/p/zwgjkq/javascript-analogue-of-ruby-s-any
191410
function _all(o) {
        var a = [];
        if (typeof o!=='object') throw new Error('Invalid Arg: not an object');
        // return true if o is hash
        if (_isHash(o)) return true;
        for (var x in o) {
          a.push((typeof o[x]==='string' && /^$/.test(o[x])) ? true : o[x]);
        }
        return a.every(Boolean);
      }
457308
def each(&block)
      # TODO: Using block.call here is slower than using yield by 5-10%, but
      # the latter segfaults on ruby 2.2 and above. Once that is fixed and
      # broken versions are sufficiently old, we should revert back to yield
      # with a warning that the broken versions are unsupported.
      #
      # For more context:
      # * https://bugs.ruby-lang.org/issues/11451
      # * https://github.com/hamstergem/hamster/issues/189
      @entries.each { |entry| block.call(entry) if entry }
      @children.each do |child|
        child.each(&block) if child
      end
      nil
    end
774015
function checkBlock(i) {
  return i < tokensLength && tokens[i].block_end ?
      tokens[i].block_end - i + 1 : 0;
}
1166469
def lock!(*args)
      fail 'No block passed' unless block_given?

      lock(*args) do |lock_info|
        raise LockError, 'failed to acquire lock' unless lock_info
        return yield
      end
    end
1032587
def each
      return to_enum(__callee__) unless block_given?

      node = self
      loop do
        yield node
        break unless (node = node.next_node)
      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
1171567
def knows_block(blockhash)
      return true if @chain.include?(blockhash)
      @block_queue.queue.any? {|(block, proto)| block.header.full_hash == blockhash }
    end
750070
def method_missing(sym,*args,&block)
      name = sym.to_s

      unless block
        if (name =~ /=$/ && args.length == 1)
          return self[name.chop.to_sym] = args.first
        elsif args.empty?
          return self[sym]
        end
      end

      return super(sym,*args,&block)
    end
228429
function isSelfReference(ref, nodes) {
            let scope = ref.from;

            while (scope) {
                if (nodes.indexOf(scope.block) >= 0) {
                    return true;
                }

                scope = scope.upper;
            }

            return false;
        }
294688
def with(&block)
      raise ArgumentError.new("Must pass a block") unless block_given?
      case block.arity
        when 1
          yield self
        when 0
          instance_methods_eval(&block)
        else
          raise "block arity must be 0 or 1"
      end
    end
783454
function( name, block ) {
		var self = this, passed = true;

		try {
			block();
		}
		catch ( e ) {
			passed = false;
		}

		return self.ok( name, passed, self.doesNotThrow, 'Block does throw error' );
	}
830314
def accepts=(args)
      if args.last == Block # Transform into a ProcContract
        args.pop
        @block_contract = ProcContract.new
        @block_contract.accepts = ClauseMethods::ANYTHING
        @block_contract.returns = ClauseMethods::ANYTHING        
      elsif args.last.is_a?(ProcContract)
        @block_contract = args.pop
      end

      if args.find_all {|o| o.is_a? Array}.length > 1
        raise ContractError, "Cannot define more than one expected variable argument"
      end
      super(args)
    end
741642
def body(value=nil, &block)
      if block_given?
        def block.each; yield(call) end
        response.body = block
      elsif value
        response.body = value
      else
        response.body
      end
    end
156254
def all(options = nil, &block)
      options = options ? Hash[options] : {}
      options[:count] = :all
      find(options, &block)
    end
690589
def each
      return enum_for(:each) unless block_given?

      execute.each do |result|
        yield(model.new(result.merge(api: api)))
      end
    end
1125941
def __mock_block_call context, block, actual_args, actual_block, splat
      return unless block
      # for AnyInstanceOf, we don't have the actual context at the time
      # we're defining it, so we update it here
      block.context = context if block.kind_of?(Block)
      if splat
        block.call(*actual_args, &actual_block)
      else # peek_return doesn't need splat
        block.call(actual_args, &actual_block)
      end
    end
365116
def if_state(*expected_states)
      mutex.lock
      raise ArgumentError, 'no block given' unless block_given?

      if expected_states.include? @state
        yield
      else
        false
      end
    ensure
      mutex.unlock
    end