third param is optional, because earlier versions of rspec sent only two args
513342
def example_pending(example, message, deprecated_pending_location=nil)
      immediately_dump_pending(example.description, message, example.location)
      mark_error_state_pending
      increment
    end
989827
def method_missing( name, *opts )
      raise NoMethodError.new( name.to_s ) unless name.to_s =~ /([a-z]*)_([a-z]*)/
 
      # command_processors
      if $2 == "processors"
        commands[$1.to_sym][:outputs] = opts.first[:outputs]
        commands[$1.to_sym][:exceptions] = opts.first[:exceptions]
      end
    end
775726
function parseArguments$3(args) {
        var first = args[0];
        var second = args[1];

        return typeof first === 'string' ? { namespace: first, mappings: second } : { namespace: null, mappings: first };
    }
845585
def check_args(parser, args):
    """"""
    # Make sure only one action has been specified
    if len([a for a in [args.create, args.extract, args.verify, args.list,
                        args.list_detailed, args.hash, args.add_signature] if a
            is not None]) != 1:
        parser.error("Must specify something to do (one of -c, -x, -t, -T, -v, --hash, --add-signature)")

    if args.create and not args.files:
        parser.error("Must specify at least one file to add to marfile")

    if args.extract and args.compression not in (None, 'bz2', 'xz', 'auto'):  # pragma: nocover
        parser.error('Unsupported compression type')

    if args.create and args.compression not in (None, 'bz2', 'xz'):  # pragma: nocover
        parser.error('Unsupported compression type')

    if args.hash and len(args.files) != 1:
        parser.error("Must specify a file to output the hash for")
1314642
def _pv_required(opts, key, is_required=true)
        if is_required
          if (opts.has_key?(key.to_s) && !opts[key.to_s].nil?) ||
              (opts.has_key?(key.to_sym) && !opts[key.to_sym].nil?)
            true
          else
            raise ValidationFailed, "Required argument #{key} is missing!"
          end
        end
      end
405383
def index
      validate_arguments!

      app_buildpacks = api.get_app_buildpacks_v3(app)[:body]

      if app_buildpacks.nil? or app_buildpacks.empty?
        display("#{app} has no Buildpack URL set.")
      else
        styled_header("#{app} Buildpack URL#{app_buildpacks.size > 1 ? 's' : ''}")
        display_buildpacks(app_buildpacks.map{|bp| bp["buildpack"]["url"]}, "")
      end
    end
475751
function missingParamError () {
	var params = new Parameterizer (null, null);
	params.get = function (key) {
		throw new Error ('missing param ' + key);
	};
	return params;
}
150062
def check_args(hash)
        if !hash.include? :hostname
          raise ArgumentError, "You must provide a hostname"
        elsif !hash.include? :service_name
          raise ArgumentError, "You must provide a service name"
        elsif !hash.include? :return_code
          raise ArgumentError, "You must provide a return code"
        elsif !hash.include? :status
          raise ArgumentError, "You must provide a status"
        end
      end
312991
def enforce_count(args, params, diff = 0)
      num_args = args.size
      num_params = params == 'V' ? 0 : params.size + diff
      if num_args != num_params
        raise ArgumentError, "wrong number of parameters: expected #{num_params}, got #{num_args}"
      end
    end
666930
def call(args = Array.new, options = Hash.new)
      unless self.dependencies.empty?
        info "Invoking task #{name}"
        self.invoke_dependencies(*args, options)
      end
      unless self.blocks.empty?
        note "Executing task #{name} with arguments #{args.inspect} and options #{options.inspect}"
        debug "Config #{self.config.inspect}"
        self.blocks.each do |block|
          block.call(*args, options)
        end
        ## we can't use arity, because it returns 0 for lambda { |options = Hash.new| }.arity
        ## if we define method with one optional argument, it will returns -1
        #
        ## better argv parsing maybe, task(:spec) do |*paths, options| is fine, but task(:spec) do |path, options| will fail if no path specified ... but actually task(:spec) do |path = "spec", options| might be fine, try it ... BTW task(["-i", "--interactive"]) do |task, *args, options| doesn't work ... putting options as a first argument should solve everything, but it's not very intuitive :/
        #if RUBY_VERSION >= "1.9.2"
        #  raise ArgumentError, "Task can't take block arguments" if args.length + 1 > block.parameters.select { |type, name| type.eql?(:req) || type.eql?(:opt) }.length
        #  raise ArgumentError, "Task can't take block arguments" if block.parameters.any? { |type, name| type.eql?(:block) }
        #end
        #
        #if RUBY_VERSION >= "1.9.2" && block.parameters.empty?
        #  block.call
        #else
        #  block.call(*args, options)
        #end
      end
    end
184303
def general_params(cls):
        

        optional_bool_none = {
            "optional": True,
            "default": None,
            "type": bool
        }
        optional_string_none = {
            "optional": True,
            "default": None,
            "type": str
        }
        optional_int_none = {
            "optional": True,
            "default": None,
            "type": int
        }
        optional_empty_list = {
            "optional": True,
            "default": [],
            "type": list
        }
        no_optional_empty_string = {
            "optional": False,
            "default": "",
            "type": str
        }
        no_optional_true = {
            "optional": False,
            "default": True,
            "type": bool
        }
        optional_false = {
            "optional": True,
            "default": False,
            "type": bool
        }

        params = {}

        # GENERAL CONFIG
        params_general = {
            "general": {
                "sleep": optional_int_none,  # we are not using it
                "min_update_delay": {
                    "optional": True,
                    "default": 60,
                    "type": int
                },
                "kibana": {
                    "optional": True,
                    "default": "5",
                    "type": str
                },
                "update": {
                    "optional": False,
                    "default": False,
                    "type": bool
                },
                "short_name": {
                    "optional": False,
                    "default": "Short name",
                    "type": str
                },
                "debug": {
                    "optional": False,
                    "default": True,
                    "type": bool
                },
                "from_date": optional_string_none,  # per data source param now
                "logs_dir": {
                    "optional": False,
                    "default": "logs",
                    "type": str
                },
                "bulk_size": {
                    "optional": True,
                    "default": 1000,
                    "type": int
                },
                "scroll_size": {
                    "optional": True,
                    "default": 100,
                    "type": int
                }

            }
        }
        params_projects = {
            "projects": {
                "projects_file": {
                    "optional": True,
                    "default": "projects.json",
                    "type": str
                },
                "projects_url": {
                    "optional": True,
                    "default": None,
                    "type": str
                },
                "load_eclipse": {
                    "optional": True,
                    "default": False,
                    "type": bool
                }
            }
        }

        params_phases = {
            "phases": {
                "collection": no_optional_true,
                "enrichment": no_optional_true,
                "identities": no_optional_true,
                "panels": no_optional_true,
                "track_items": optional_false,
                "report": optional_false
            }
        }

        general_config_params = [params_general, params_projects, params_phases]

        for section_params in general_config_params:
            params.update(section_params)

        # Config provided by tasks
        params_collection = {
            "es_collection": {
                "password": optional_string_none,
                "user": optional_string_none,
                "url": {
                    "optional": False,
                    "default": "http://172.17.0.1:9200",
                    "type": str
                },
                "arthur": optional_false,
                "arthur_url": optional_string_none,
                "redis_url": optional_string_none
            }
        }

        params_enrichment = {
            "es_enrichment": {
                "url": {
                    "optional": False,
                    "default": "http://172.17.0.1:9200",
                    "type": str
                },
                "studies": optional_bool_none,
                "autorefresh": {
                    "optional": True,
                    "default": True,
                    "type": bool
                },
                "user": optional_string_none,
                "password": optional_string_none
            }
        }

        params_panels = {
            "panels": {
                "kibiter_time_from": {
                    "optional": True,
                    "default": "now-90d",
                    "type": str
                },
                "kibiter_default_index": {
                    "optional": True,
                    "default": "git",
                    "type": str
                }
            }
        }

        params_report = {
            "report": {
                "start_date": {
                    "optional": False,
                    "default": "1970-01-01",
                    "type": str
                },
                "end_date": {
                    "optional": False,
                    "default": "2100-01-01",
                    "type": str
                },
                "interval": {
                    "optional": False,
                    "default": "quarter",
                    "type": str
                },
                "config_file": {
                    "optional": False,
                    "default": "report.cfg",
                    "type": str
                },
                "data_dir": {
                    "optional": False,
                    "default": "report_data",
                    "type": str
                },
                "filters": optional_empty_list,
                "offset": optional_string_none
            }
        }

        params_sortinghat = {
            "sortinghat": {
                "affiliate": {
                    "optional": False,
                    "default": "True",
                    "type": bool
                },
                "unaffiliated_group": {
                    "optional": False,
                    "default": "Unknown",
                    "type": str
                },
                "unify_method": {  # not used
                    "optional": True,
                    "default": "fast-matching",
                    "type": str
                },
                "matching": {
                    "optional": False,
                    "default": ["email"],
                    "type": list
                },
                "sleep_for": {
                    "optional": False,
                    "default": 3600,
                    "type": int
                },
                "database": {
                    "optional": False,
                    "default": "sortinghat_db",
                    "type": str
                },
                "host": {
                    "optional": False,
                    "default": "mariadb",
                    "type": str
                },
                "user": {
                    "optional": False,
                    "default": "root",
                    "type": str
                },
                "password": no_optional_empty_string,
                "autoprofile": {
                    "optional": False,
                    "default": ["customer", "git", "github"],
                    "type": list
                },
                "load_orgs": {
                    "optional": True,
                    "default": False,
                    "type": bool,
                    "deprecated": "Orgs are loaded if defined always"
                },
                "identities_format": {
                    "optional": True,
                    "default": "sortinghat",
                    "type": str,
                    "doc": "Format of the identities data to be loaded"
                },
                "github_api_token": {
                    "optional": True,
                    "default": None,
                    "type": str,
                    "deprecated": "Use identities_api_token"
                },
                "strict_mapping": {
                    "optional": True,
                    "default": True,
                    "type": bool,
                    "doc": "rigorous check of values in identities matching " + \
                           "(i.e, well formed email addresses)"
                },
                "reset_on_load": {
                    "optional": True,
                    "default": False,
                    "type": bool,
                    "doc": "Unmerge and remove affiliations for all identities on load"
                },
                "orgs_file": optional_string_none,
                "identities_file": optional_empty_list,
                "identities_export_url": optional_string_none,
                "identities_api_token": optional_string_none,
                "bots_names": optional_empty_list,
                "no_bots_names": optional_empty_list  # to clean bots in SH
            }
        }

        params_track_items = {
            "track_items": {
                "project": {
                    "optional": False,
                    "default": "TrackProject",
                    "type": str
                },
                "upstream_raw_es_url": no_optional_empty_string,
                "raw_index_gerrit": no_optional_empty_string,
                "raw_index_git": no_optional_empty_string
            }
        }

        params_enrich_onion = {
            "enrich_onion": {
                "in_index": {
                    "optional": False,
                    "default": None,
                    "type": str
                },
                "out_index": {
                    "optional": False,
                    "default": None,
                    "type": str
                },
                "contribs_field": {
                    "optional": True,
                    "default": "hash",
                    "type": str
                },
                "no_incremental": {
                    "optional": True,
                    "default": True,
                    "type": bool
                }
            }
        }

        params_enrich_areas_of_code = {
            "enrich_areas_of_code": {
                "in_index": {
                    "optional": False,
                    "default": None,
                    "type": str
                },
                "out_index": {
                    "optional": False,
                    "default": None,
                    "type": str
                },
                "no_incremental": {
                    "optional": True,
                    "default": True,
                    "type": bool
                }
            }
        }

        params_enrich_demography = {
            "enrich_demography": {
                "no_incremental": {
                    "optional": True,
                    "default": True,
                    "type": bool
                }
            }
        }

        tasks_config_params = [params_collection, params_enrichment, params_panels,
                               params_report, params_sortinghat, params_track_items,
                               params_enrich_areas_of_code, params_enrich_demography,
                               params_enrich_onion]

        for section_params in tasks_config_params:
            params.update(section_params)

        return params
1157654
function _parseParams(params, defaults) {
  const options = {};
  const attrs = {};

  Utils.each(params, (value, key) => {
    const coerced = Utils.coerceType(value);

    if (Utils.has(defaults.options, key)) {
      options[key] = coerced;
    } else if (Utils.has(defaults.attrs, key)) {
      attrs[key] = coerced;
    }
  });

  return [options, attrs];
}
1128763
function validateParams(fs, param2) {
  var err;

  if(!fs) {
    err = new Errors.EINVAL('No filesystem provided');
  } else if(!param2) {
    err = new Errors.EINVAL('Second argument must be specified');
  }

  return err;
}
670042
function checkArgs(args) {
  if (args.length !== 2) {
    console.warn(`WWWW Checking claudia args: args.length !== 2, is: ${args.length}`, inspect({args}));
  }
}
1233416
def get_three_parameters(self, regex_exp, parameters):
        
        Rx, Ry, Rz, other = self.get_parameters(regex_exp, parameters)
        if other is not None and other.strip():
            raise iarm.exceptions.ParsingError("Extra arguments found: {}".format(other))
        return Rx.upper(), Ry.upper(), Rz.upper()
410927
def noargs(self):
        ""
        noargs = inspect.ArgSpec(args=[], varargs=None, keywords=None, defaults=None)
        return self.argspec == noargs
436111
def RORS(self, params):
        
        # This instruction allows for an optional destination register
        # If it is omitted, then it is assumed to be Rb
        # As defined in http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0662b/index.html
        try:
            Ra, Rb, Rc = self.get_three_parameters(self.THREE_PARAMETER_COMMA_SEPARATED, params)
        except iarm.exceptions.ParsingError:
            Rb, Rc = self.get_two_parameters(self.TWO_PARAMETER_COMMA_SEPARATED, params)
            Ra = Rb

        # TODO implement this function
        # TODO figure out the last shifted bit
        # TODO figure out how to wrap bits around
        raise iarm.exceptions.NotImplementedError

        # RORS Ra, Ra, Rb
        self.check_arguments(low_registers=(Ra, Rc))
        self.match_first_two_parameters(Ra, Rb)

        def RORS_func():
            raise NotImplementedError

        return RORS_func