Will call the given block with all the actual arguments every time
 the method is called
771241
def and_before_calling_original
      self.and_wrap_original do |m, *args, &block|
        yield *args
        m.call(*args, &block)
      end
    end
881029
def set_block_argument_names
      @block_argument_names = if has_block? && element[2].is_a?(Sexp) # HACK: for lambdas
                                element[2].drop(1).map { |argument| argument }
                              end || []
    end
358844
def block_param(*type_and_name)
      case type_and_name.size
      when 0
        type = @all_callables
        name = :block
      when 1
        type = @all_callables
        name = type_and_name[0]
      when 2
        type, name = type_and_name
        type = Puppet::Pops::Types::TypeParser.singleton.parse(type, loader) unless type.is_a?(Puppet::Pops::Types::PAnyType)
      else
        raise ArgumentError, _("block_param accepts max 2 arguments (type, name), got %{size}.") % { size: type_and_name.size }
      end

      unless Puppet::Pops::Types::TypeCalculator.is_kind_of_callable?(type, false)
        raise ArgumentError, _("Expected PCallableType or PVariantType thereof, got %{type_class}") % { type_class: type.class }
      end

      unless name.is_a?(Symbol)
        raise ArgumentError, _("Expected block_param name to be a Symbol, got %{name_class}") % { name_class: name.class }
      end

      if @block_type.nil?
        @block_type = type
        @block_name = name
      else
        raise ArgumentError, _('Attempt to redefine block')
      end
    end
554297
def call *args
      # catch cuts
      catch :rubylog_cut do

        # for each rule
        each do |rule|
          # compile
          rule = rule.rubylog_match_variables

          # unify the head with the arguments
          rule.head.args.rubylog_unify(args) do
            # call the body
            rule.body.prove do
              yield 
            end
          end
        end
      end
    end
540589
def call(args = [])
      object, meth = @when_called[0, 2]
      meth ||= :call
      options = proxy_option_struct

      case object
      when Proc then object.call(args, options)
      when Class then meth != :call ? object.new.send(meth, args, options) : object.new(args, options)
      else object.send(meth, args, options) if object
      end
    end
345004
function() {
    // Check for duplicated arguments.
    var badArg = false;
    var hash = {};
    for (var i = 0; i < this.arguments_.length; i++) {
      if (hash['arg_' + this.arguments_[i].toLowerCase()]) {
        badArg = true;
        break;
      }
      hash['arg_' + this.arguments_[i].toLowerCase()] = true;
    }
    if (badArg) {
      this.setWarningText(Blockly.Msg.PROCEDURES_DEF_DUPLICATE_WARNING);
    } else {
      this.setWarningText(null);
    }
    // Merge the arguments into a human-readable list.
    var paramString = '';
    if (this.arguments_.length) {
      paramString = Blockly.Msg.PROCEDURES_BEFORE_PARAMS +
          ' ' + this.arguments_.join(', ');
    }
    // The params field is deterministic based on the mutation,
    // no need to fire a change event.
    Blockly.Events.disable();
    this.setFieldValue(paramString, 'PARAMS');
    Blockly.Events.enable();
  }
103938
def on_complete(&block)
      on do |_, value, reason|
        block.call(reason == nil, value, reason)
      end
    end
353468
def method_missing(name, *args, &block)
      if args.empty? && !block_given? && @arg_names.include?(name)
        @args[name]
      else
        super
      end
    end
1173891
def call(object, method, *args, &block)
      options = args.last.is_a?(Hash) ? args.pop : {}
      options = {:method_name => method}.merge(options)
      state = machine.states.match!(object)

      if state == self && object.respond_to?(method)
        object.send(method, *args, &block)
      elsif method_missing = options[:method_missing]
        # Dispatch to the superclass since the object either isn't in this state
        # or this state doesn't handle the method
        begin
          method_missing.call
        rescue NoMethodError => ex
          if ex.name.to_s == options[:method_name].to_s && ex.args == args
            # No valid context for this method
            raise InvalidContext.new(object, "State #{state.name.inspect} for #{machine.name.inspect} is not a valid context for calling ##{options[:method_name]}")
          else
            raise
          end
        end
      end
    end
774241
def method_missing(m, *args, &block)
      if m.to_s =~ /^with_(.+)$/
        with($1.to_sym => args.first)
        self
      else
        super
      end
    end
371794
def post(*args, &task)
      raise ArgumentError, 'no block given' unless block_given?
      return false unless running?
      task.call(*args)
      true
    end
601849
def call(name, given_options)
      # TODO: allow to receive rest of options/block in dynamic block. or, rather, test it as it was already implemented.
      evaluated_options = @dynamic_options.(name, given_options)

      options = Variables.merge( @static_options, handle_array_and_deprecate(evaluated_options) )
      options = Variables.merge( options, handle_array_and_deprecate(given_options) ) # FIXME: given_options is not tested!
    end
1211228
def call(self):
        """"""
        assert self.satisfied, self
        LOG.debug('call %s.%s', self.func.__module__, self.func.__qualname__)
        kwargs = {arg.name: arg.read() for arg in self.args}
        out_value = self.func(**kwargs)
        if self.writeto is None:
            writeto = set()
        elif isinstance(self.writeto, Variable):
            self.writeto.write(out_value)
            writeto = {self.writeto}
        else:
            # A variable can be written multiple times, but we only
            # return a unique set of variables.
            for var, value in zip(self.writeto, out_value):
                var.write(value)
            writeto = set(self.writeto)
        self._release()  # Only call _release() on normal exit.
        return writeto
795874
def and_call_through
      if @base_object.is_a? Class
        @plan = Proc.new do |object, *args, &block|
          if original_method
            if original_method.is_a? UnboundMethod
              bound_method = original_method.bind(object)
              bound_method.call(*args, &block)
            else
              original_method.call(*args, &block)
            end
          else
            base_object.send(:method_missing, method_name, *args, &block)
          end
        end
      else
        @plan = Proc.new do |*args, &block|
          if original_method
            original_method.call(*args, &block)
          else
            base_object.send(:method_missing, method_name, *args, &block)
          end
        end
      end

      self
    end
1272164
def call(*args, &block)
      self.result = defined?(super) ? super(*args, &block) : to_proc.call(*args, &block)
    end
427554
function calledWith() {
  var calledWithCount = 0;
  var args = [];
  var argsLength = arguments.length;
  for (var i = 0; i < argsLength; i++) {
    args[i] = arguments[i];
  }
  var callsLength = this._calls.length;
  CALLS: for (var i = 0; i < callsLength; i++) {
    var match = false;
    var called = this._calls[i];
    var calledLength = called.length;
    if (argsLength === 0 && calledLength === 0) {
      match = true;
    } else {
      ARGS: for (var a = 0; a < argsLength; a++) {
        match = matchArgs(args[a],called[a]);
        if (!match) {
          break ARGS;
        }
      }
    }
    if (match) {
      calledWithCount++;
    }
  }
  return calledWithCount;
}
870048
def method_missing(name, *args, &block)
      getter_name = name[0..-2]

      if name =~ /^[a-z]+=$/ && !respond_to?(getter_name)
        define_accessor(getter_name, args.first)
      else
        super
      end
    end