Check if parameters are okay.

        Sanity check makes sure each parameter is within an allowable range.

        Raises:
            ValueError: Problem with a specific parameter.
437488
def _sanity_check(self):
        
        if any(self.m1 < 0.0):
            raise ValueError("Mass 1 is negative.")
        if any(self.m2 < 0.0):
            raise ValueError("Mass 2 is negative.")

        if any(self.z <= 0.0):
            raise ValueError("Redshift is zero or negative.")

        if any(self.dist <= 0.0):
            raise ValueError("Distance is zero or negative.")

        if any(self.initial_point < 0.0):
            raise ValueError("initial_point is negative.")

        if any(self.t_obs < 0.0):
            raise ValueError("t_obs is negative.")

        if any(self.e0 <= 0.0):
            raise ValueError("e0 must be greater than zero when using EccentricBinaries class.")

        if any(self.e0 > 1.0):
            raise ValueError("e0 greater than 1.")

        return
782727
def _check_parameters(self):
        
        if self._map_type != "planar" and self._map_type != "toroid":
            raise Exception("Invalid parameter for _map_type: " +
                            self._map_type)
        if self._grid_type != "rectangular" and self._grid_type != "hexagonal":
            raise Exception("Invalid parameter for _grid_type: " +
                            self._grid_type)
        if self._neighborhood != "gaussian" and self._neighborhood != "bubble":
            raise Exception("Invalid parameter for neighborhood: " +
                            self._neighborhood)
        if self._kernel_type != 0 and self._kernel_type != 1:
            raise Exception("Invalid parameter for kernelTye: " +
                            self._kernel_type)
        if self._verbose < 0 and self._verbose > 2:
            raise Exception("Invalid parameter for verbose: " +
                            self._kernel_type)
1166749
def check_ranged_param(ranged_param, allowed)
      🔞 = ranged_param.keys.map(&:to_sym) - allowed.map(&:to_sym)
      raise InvalidRangeException, "Attributes #{🔞.map(&:to_s).to_sentence} doesn't exists or aren't rangeables. Available ranges are: #{allowed.to_sentence}" if 🔞.any?
    end
1084137
def _validate_allowed(self, allowed_values, field, value):
        
        if isinstance(value, Iterable) and not isinstance(value, _str_type):
            unallowed = set(value) - set(allowed_values)
            if unallowed:
                self._error(field, errors.UNALLOWED_VALUES, list(unallowed))
        else:
            if value not in allowed_values:
                self._error(field, errors.UNALLOWED_VALUE, value)
855536
def valid_options(kwargs, allowed_options):
    

    diff = set(kwargs) - set(allowed_options)
    if diff:
        print("Invalid option(s): ", ', '.join(diff))
        return False
    return True
131196
void checkRange(int param) throws SQLException {

        if (param < 1 || param > parameterCount) {
            String msg = param + " is out of range";

            throw Util.outOfRangeArgument(msg);
        }
    }
907740
def _check_range(range_):
        """"""
        try:
            if not isinstance(range_, list):
                range_ = list(range_)
            min_, max_ = range_
        except (ValueError, TypeError):
            raise TypeError("each range in ising_linear_ranges should be a list of length 2.")
        if not isinstance(min_, Number) or not isinstance(max_, Number) or min_ > max_:
            raise ValueError(("each range in ising_linear_ranges should be a 2-tuple "
                              "(min, max) where min <= max"))
        return range_
717686
def check(self):
        
        try:
            value = self.raw_value
        except (AttributeError, KeyError) as err:
            self._reraise_if_required(err)
        else:
            if self.checker:
                self.checker(self.full_name, value)
            try:
                self.validate(value)
                self.run_validators(value)
            except ValidationError as error:
                raise ValueError("Setting {} has an invalid value: {}".format(self.full_name, error))
807191
def check_params(**kwargs):
    

    missing_params = []
    check = True

    for param in kwargs:
        if kwargs[param] is None:
            missing_params.append(param)

    if len(missing_params) > 0:
        print("POT - Warning: following necessary parameters are missing")
        for p in missing_params:
            print("\n", p)

        check = False

    return check
1147112
def is_valid(cls, arg):
        """"""
        if not isinstance(arg, (int, long)) or isinstance(arg, bool):
            return False
        if (arg < cls._low_limit):
            return False
        if (cls._high_limit is not None) and (arg > cls._high_limit):
            return False
        return True
1270380
def __args_check(self, valid, args=None, kwargs=None):
        '''
        
        '''
        if not isinstance(valid, list):
            valid = [valid]
        for cond in valid:
            if not isinstance(cond, dict):
                # Invalid argument
                continue
            # whitelist args, kwargs
            cond_args = cond.get('args', [])
            good = True
            for i, cond_arg in enumerate(cond_args):
                if args is None or len(args) <= i:
                    good = False
                    break
                if cond_arg is None:  # None == '.*' i.e. allow any
                    continue
                if not self.match_check(cond_arg, six.text_type(args[i])):
                    good = False
                    break
            if not good:
                continue
            # Check kwargs
            cond_kwargs = cond.get('kwargs', {})
            for k, v in six.iteritems(cond_kwargs):
                if kwargs is None or k not in kwargs:
                    good = False
                    break
                if v is None:  # None == '.*' i.e. allow any
                    continue
                if not self.match_check(v, six.text_type(kwargs[k])):
                    good = False
                    break
            if good:
                return True
        return False
477998
def validate_range_values(request, label, kwargs):
    """"""
    value = kwargs.get(label, request.query.get(label))
    if value:
        kwargs[label] = int(value)
        if kwargs[label] < 0 or kwargs[label] > MAX_PAGE_SIZE:
            raise ValueError
429361
def valid?
      begin
        self.each do |threshold|
          if threshold.respond_to?(:valid?)
            return false unless threshold.valid?
          else
            raise InvalidThresholdsObject, "Container object has unknown objects"
          end
        end
        return true
      rescue InvalidThresholdsObject
        return false
      end
    end
707018
def _def_check(self):
        
        if self._def != dict():
            for key, val in iteritems_(self._def):
                if key not in list(TEXT_INDEX_ARGS.keys()):
                    raise CloudantArgumentError(127, key)
                if not isinstance(val, TEXT_INDEX_ARGS[key]):
                    raise CloudantArgumentError(128, key, TEXT_INDEX_ARGS[key])
736179
def check_parameters
      errors = ""
      @url.scan(/:(\w*)/).flatten.map(&:to_sym).each do |arg|
        errors += "<li><p>parameter '#{arg.to_s}' is required</p></li>" unless @attributes.has_key?(arg)
      end
      errors.empty? ? "" : "<ul>#{errors}</ul>"
    end
1293594
private void check() {
		final Constructor<?> constructor = getConstructor();
		final XParameter[] parameters = getParameters();
		final Class<?>[] parameterTypes = constructor.getParameterTypes();
		Validate.isTrue(parameters.length == parameterTypes.length,
				"Wrong number of parameters: [" + parameters.length
						+ "], expected [" + parameterTypes.length + "].");
		for (int index = 0; index < parameters.length; index++) {
			final XParameter parameter = parameters[index];
			final Class<?> parameterType = parameterTypes[index];
			Validate.isTrue(parameterType.equals(parameter.getType()),
					"Wrong parameter type: [" + parameter.getType()
							+ "], expected [" + parameterType + "]");
		}
	}
859274
def sanitycheck(self):
        
        # logging.info('Starting Sanity Check...')
        tstart = datetime.now()

        # command = 'python %s/sanity_check.py -i %s' % (scripts_dir, self.vcf_file)
        # self.shell(command)

        sc = sanity_check.Sanity_check(self.vcf_file)
        std = sc.run()

        tend = datetime.now()
        execution_time = tend - tstart