Validate the user specified regions are valid
        :return:
976363
def validate_regions(self):
        
        for region in self.aws_regions:
            if region not in aws_regions:
                print "Error: Specified region: {} is not a valid aws_region".format(region)
                print "Valid regions are: {}".format(aws_regions)
613877
def node_contained_in_layer_area_validation(self):
    
    # if area is a polygon ensure it contains the node
    if self.layer and isinstance(self.layer.area, Polygon) and not self.layer.area.contains(self.geometry):
        raise ValidationError(_('Node must be inside layer area'))
1130616
protected function validateZoneCountryState()
    {
        $field = 'zone_id';
        $value = $this->getSubmitted($field);

        if (empty($value)) {
            return null;
        }

        $label = $this->translation->text('Zone');

        if (!is_numeric($value)) {
            $this->setErrorNumeric($field, $label);
            return false;
        }

        $zone = $this->zone->get($value);

        if (empty($zone)) {
            $this->setErrorUnavailable($field, $label);
            return false;
        }

        return true;
    }
1044877
def validate(self):
        

        extents_valid = (0 <= self.lower_extent <= self.upper_extent
            <= self.global_size)

        if not extents_valid:
            raise ValueError("Dimension '{d}' fails 0 <= {el} <= {eu} <= {gs}"
                .format(d=self.name, gs=self.global_size,
                    el=self.lower_extent, eu=self.upper_extent))
874250
@SuppressWarnings("unchecked")
    protected void validate() {

        if (m_ou == null) {
            m_name.removeAllValidators();
            m_name.addValidator(new NameValidator());
        }
        m_description.setRequired(true);
        m_description.setRequiredError("Required");

        if (m_ouResources.getRows().isEmpty() & !m_webuser.getValue().booleanValue()) {
            CmsPathSelectField field = new CmsPathSelectField();
            field.setUseRootPaths(true);
            field.setCmsObject(m_cms);
            m_ouResources.addRow(field);
        }
        for (I_CmsEditableGroupRow row : m_ouResources.getRows()) {
            ((AbstractField<String>)row.getComponent()).removeAllValidators();
            ((AbstractField<String>)row.getComponent()).addValidator(new ResourceValidator());
        }
    }
1049898
def assert_consistent_regions(from_spec, from_command_line, builder_exception):
    
    if from_spec is None or from_command_line is None:
        return
    if set(from_spec) != set(from_command_line):
        raise builder_exception("--region and the 'regionalOptions' key in the JSON file do not agree")
1023720
def _validate(self, sam_template):
        

        if "Resources" not in sam_template or not isinstance(sam_template["Resources"], dict) \
                or not sam_template["Resources"]:
            raise InvalidDocumentException(
                [InvalidTemplateException("'Resources' section is required")])

        SamTemplateValidator.validate(sam_template)
553961
def _validate(self):
        """"""
        if self.tpid.value not in (EtherType.VLAN, EtherType.VLAN_QINQ):
            raise UnpackException
        return
734938
def _ValidateClosedTimeRange(time_range):
  """"""
  time_range_start, time_range_end = time_range
  _ValidateTimestamp(time_range_start)
  _ValidateTimestamp(time_range_end)
  if time_range_start > time_range_end:
    raise ValueError("Invalid time-range: %d > %d." %
                     (time_range_start.AsMicrosecondsSinceEpoch(),
                      time_range_end.AsMicrosecondsSinceEpoch()))
614766
def is_valid_sites(self):
        
        if 'site_model' in self.inputs and 'sites' in self.inputs:
            return False
        elif 'site_model' in self.inputs and self.sites:
            return False
        elif 'sites' in self.inputs and self.sites:
            return False
        elif self.sites and self.region and self.region_grid_spacing:
            return False
        else:
            return True
137762
def validate(self, r):
        '''
        
        '''
        if self.show_invalid:
            r.valid = True
        elif r.valid:
            if not r.description:
                r.valid = False

            if r.size and (r.size + r.offset) > r.file.size:
                r.valid = False

            if r.jump and (r.jump + r.offset) > r.file.size:
                r.valid = False

            if hasattr(r, "location") and (r.location != r.offset):
                r.valid = False

        if r.valid:
            # Don't keep displaying signatures that repeat a bunch of times
            # (e.g., JFFS2 nodes)
            if r.id == self.one_of_many:
                r.display = False
            elif r.many:
                self.one_of_many = r.id
            else:
                self.one_of_many = None
271865
def validate(self):
        
        assert self.path, "{} must have a path".format(self.__class__.__name__)
        ext = extract_path_ext(self.path, default_ext=self.subtitlesformat)
        if ext not in self.allowed_formats and ext not in CONVERTIBLE_FORMATS[self.get_preset()]:
            raise ValueError('Incompatible extension {} for SubtitleFile at {}'.format(ext, self.path))
244212
function checkExecParamsRegionSuccessError(region, success, error)
{
	var caller = checkExecParamsRegionSuccessError.caller.name

	if (typeof region != 'object') {
		console.error('Error: region parameter is not an object in: ' + caller);
		return false;
	}

	if (typeof success != 'function') {
		console.error('Error: success parameter is not a function in: ' + caller);
		return false;
	}

	if (typeof error != 'function') {
		console.error('Error: error parameter is not a function in: ' + caller);
		return false;
	}

	return true;
}
577176
def isRegionValid(self):
        
        screens = PlatformManager.getScreenDetails()
        for screen in screens:
            s_x, s_y, s_w, s_h = screen["rect"]
            if self.x+self.w >= s_x and s_x+s_w >= self.x and self.y+self.h >= s_y and s_y+s_h >= self.y:
                # Rects overlap
                return True
        return False
924396
def validate(cls, code, prefix):
        '''
        
        '''
        reasons = []

        pieces = code.split('-')
        n = len(pieces)
        if n > 3:
            reasons.append('{}invalid geo code "{}"'.format(prefix, code))
        elif n > 0 and pieces[0] not in geo_data:
            reasons.append('{}unknown continent code "{}"'
                           .format(prefix, code))
        elif n > 1 and pieces[1] not in geo_data[pieces[0]]:
            reasons.append('{}unknown country code "{}"'.format(prefix, code))
        elif n > 2 and \
                pieces[2] not in geo_data[pieces[0]][pieces[1]]['provinces']:
            reasons.append('{}unknown province code "{}"'.format(prefix, code))

        return reasons
1087474
def validate(self, uri):
		
		if WURIComponentVerifier.validate(self, uri) is False:
			return False
		try:
			WStrictURIQuery(
				WURIQuery.parse(uri.component(self.component())),
				*self.__specs,
				extra_parameters=self.__extra_parameters
			)
		except ValueError:
			return False
		return True
110864
def validate(self, **kwargs):
        
        self.check_crossrefs()
        for value in self.values():
            value.validate(**kwargs)