Returns whether the parameter is optional or required
        :return: Return True if optional, False if required
494723
def is_optional(self):
        
        if (('optional' in self.attributes and bool(self.attributes['optional'].strip())) and
                ('minValue' in self.attributes and self.attributes['minValue'] == 0)):
            return True
        else:
            return False
1330105
def all_optional_fields(self):
        
        def optional_check(f):
            return is_nullable_type(f.data_type) or f.has_default
        return self._filter_fields(optional_check)
1170985
def required(field):
    

    def wrap(f):
        def wrappedf(*args):
            result = f(*args)
            if result is None or result == "":
                raise Exception(
                    "Config option '%s' is required." % field)
            else:
                return result
        return wrappedf
    return wrap
394617
private boolean isRequiredViaNestedRequiredValidator() {
        boolean result = false;
        if (null == validators) {
            return result;
        }
        Iterator<Validator> iter = validators.iterator();
        while (iter.hasNext()) {
            if (iter.next() instanceof RequiredValidator) {
                // See JAVASERVERFACES-2526.  Note that we can assume
                // that at this point the validator is not disabled, 
                // so the mere existence of the validator implies it is
                // enabled.
                result = true;
                Object submittedValue = getSubmittedValue();
                if (submittedValue == null) {
                    // JAVASERVERFACES-3058 asserts that view parameters 
                    // should be treated differently than form parameters
                    // if they are not submitted.  I'm not sure if that's 
                    // correct, but let's put this in and see how 
                    // the community responds.
                    this.setSubmittedValue("");
                }
                break;
            }
        }
                
        return result;
    }
646601
def get_cgi_parameter_bool_or_none(form: cgi.FieldStorage,
                                   key: str) -> Optional[bool]:
    
    return get_cgi_parameter_bool_or_default(form, key, default=None)
86187
public boolean hasParams() {
		return !cookieParams.isEmpty() || !urlParams.isEmpty() || !formParams.isEmpty() || !headerParams.isEmpty() || !multipartParams.isEmpty();
	}
237287
def _check_create_parameters(self, **kwargs):
        
        rset = self._meta_data['required_creation_parameters']
        check = _missing_required_parameters(rset, **kwargs)
        if check:
            error_message = 'Missing required params: %s' % check
            raise MissingRequiredCreationParameter(error_message)
527576
public static boolean isRequired(TypeDeclaration type) {
		if (type == null || type.required() == null) {
			return true;
		} else {
			return type.required();
		}
	}
153227
def is_required_version(version, specified_version):
    
    # Certain packages may be defined with multiple values.
    if isinstance(specified_version, dict):
        specified_version = specified_version.get("version", "")
    if specified_version.startswith("=="):
        return version.strip() == specified_version.split("==")[1].strip()

    return True
1035948
def _check_required(self, requires, **kwargs):
        
        for req in requires:
            # PayPal api is never mixed-case.
            if req.lower() not in kwargs and req.upper() not in kwargs:
                raise PayPalError('missing required : %s' % req)
1078830
def isSet(self, param):
        
        param = self._resolveParam(param)
        return param in self._paramMap
484654
def require(*requirements, **kwargs):
    
    # TODO: require(*requirements, none_on_failure=False) is not supported by Python 2
    none_on_failure = kwargs.get('none_on_failure', False)

    def inner(f):
        @functools.wraps(f)
        def wrapper(*args, **kwargs):
            for req in requirements:
                if none_on_failure:
                    if not getattr(req, 'is_available'):
                        return None
                else:
                    getattr(req, 'require')()
            return f(*args, **kwargs)
        return wrapper
    return inner
1125836
def check_required_params(self):
        
        for param in self.REQUIRED_FIELDS:
            if param not in self.params:
                raise ValidationError("Missing parameter: {} for {}".format(
                    param, self.__class__.path
                ))

        for child in self.TASKS:
            for param in child.REQUIRED_FIELDS:
                if param not in self.params:
                    raise ValidationError(
                        "Missing parameter: {} for {}".format(param, child.path)
                    )
262915
def verify_param(self, param, must=[], r=None):
        ''''''
        if APIKEY not in param:
            param[APIKEY] = self.apikey()

        r = Result() if r is None else r
        for p in must:
            if p not in param:
                r.code(Code.ARGUMENT_MISSING).detail('missing-' + p)
                break

        return r
1105576
def is_required(action):
  ''' '''
  return not action.option_strings and not isinstance(action, _SubParsersAction) or action.required == True
310374
def meets_requirements?(params)
      requirements.reject {|k| params.keys.map(&:to_s).include? k.to_s }.empty?
    end
139548
private static boolean isRequired(ValidatorInfo info) {
		if (null != info) {
			for (ConstraintInfo constraint : info.getConstraints()) {
				if (constraint instanceof NotNullConstraintInfo) {
					return true;
				}
			}
		}
		return false;
	}