Validate the metadata

@return void
480603
public function validate()
    {
        if (!$this->translations) {
            throw new MappingException(sprintf('No translations specified for %s', $this->name));
        }

        if (!$this->targetEntity) {
            throw new MappingException(sprintf('No translations targetEntity specified for %s', $this->name));
        }
    }
705878
def _validate_metadata(metadata_props):
    '''
    
    '''
    if len(CaseInsensitiveDict(metadata_props)) != len(metadata_props):
        raise RuntimeError('Duplicate metadata props found')

    for key, value in metadata_props.items():
        valid_values = KNOWN_METADATA_PROPS.get(key)
        if valid_values and value.lower() not in valid_values:
            warnings.warn('Key {} has invalid value {}. Valid values are {}'.format(key, value, valid_values))
174317
public static function validateMeta(array &$array)
    {

        foreach ($array as $key => $tag) {
            if (!($tag instanceof Meta)) {
                $newtag = new Meta($tag);
                $array[$key] = $newtag;
            }
        }
    }
41723
public function validate(): bool
    {
        foreach ($this as $element) {
            if ($element instanceof HasValueValidationInterface) {
                $element->validate();
            }
        }
        return $this->errors()->empty();
    }
638217
protected function _validate()
	{

		// Check if validation is necessary and parsed
		if (static::$validates === false) return true;
		if (is_null(static::$_validation)) {
			require_once("Validation/Validation.php");
			static::$_validation = Validation\Validation::onModel(get_called_class());
		}

		
		// Go validate!
		$result = static::$_validation->validate($this);

		// Success?
		if ($result->success == false) {

			// Store errors
			$this->_errors = $result->errors;

			return false;
		} else {

			// Clear errors
			$this->_errors = null;

		}

		// True
		return true;

	}
1077855
protected function validateCategoryPage()
    {
        $field = 'category_id';
        $value = $this->getSubmitted($field);

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

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

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

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

        if (empty($category['category_id'])) {
            $this->setErrorUnavailable($field, $label);
            return false;
        }

        return true;
    }
184296
protected function validateModel()
    {
        if (!is_string($this->model)) {
            $baseName = $this->getControllerBaseName();
            $this->findModelClass($baseName);
        }
    }
1193134
public function validate() : void
    {
        if (null === $this->is_valid) {
            if (null === $this->user_value && null !== $this->default_value) {
                // There is a preset value, and its not being changed
                $this->is_valid = true;
            } elseif (true == $this->user_value || 1 == $this->user_value) {
                $this->user_value = 1;
                $this->is_valid = true;
            } elseif (false == $this->user_value || 0 == $this->user_value || '' == $this->user_value) {
                $this->user_value = 0;
                $this->is_valid = true;
            } elseif (false == $this->validator) {
                // This field does not get validated
                $this->is_valid = true;
            } else {
                $this->is_valid = false;
                $this->error = 'The provided value is not valid. Please enter a valid value.';
            }
        }

        // Check if the input is different from the default value
        if ($this->is_valid && null !== $this->user_value) {
            $this->is_changed = ($this->default_value != $this->user_value);
        }
    }
25918
function validateMetadata(metadataPath, cb) {
  validateJSonStructure(metadataPath, function(err, metadataObject) {
    if (err) {
      cb(err, null);
    } else {
      cb(null, metadataObject.files);
    }
  });
}
943881
protected function validateEditor()
    {
        $this->setSubmitted('editor', null, false);

        $this->setSubmitted('user_id', $this->uid);
        $this->setSubmitted('path', $this->data_file);
        $this->setSubmitted('module', $this->data_module);

        $this->validateSyntaxEditor();

        return !$this->hasErrors();
    }
1259244
public function validate()
	{
		$errors = array();
		foreach ($this->config->getAllTypeMaps() as $typeMap) {
			try {
				$typeMap->validate();
			} catch (\Exception $e) {
				$errors[] = $e->getMessage();
			}
		}

		if (!empty($errors)) {
			throw new ValidationException(implode("\n\n", $errors));
		}
	}
710686
private function validatePlugins()
    {
        foreach (self::$cache['plugins'] as $plugin_file => $plugin_info) {
            if (!file_exists(WPMU_PLUGIN_DIR . '/' . $plugin_file)) {
                $this->updateCache();
                break;
            }
        }
    }
537428
public function validate()
    {
        foreach ($this->fieldSet as $name => $field) {
            $field->validate();

            if (!$field->isValid()) {
                $this->valid = false;
            }
        }

        $this->validated = true;
    }
931440
def validate(self):
        

        validate_properties(self._data_map, self._metadata_props)

        for prop in self._data_map:
            validate_any(prop, getattr(self, prop), self._data_structures.get(prop))

        return self
586823
protected function validate()
    {
        $args = $this->dispatcher->getParam('args');
        if (isset($this->actions[$this->actionName])) {
            $action = $this->actions[$this->actionName];
            $action->validate($args);
        }
    }
1237197
public function validate()
    {
        foreach ($this->getFields() as $field) {
            if (! isset($this->submittedData[$field->getName()])) {
                continue;
            }
            
            // is it mandatory and empty?
            if ($field->isMandatory() && strlen($this->submittedData[$field->getName()]) < 1) {
                $mandatory = new ValidationError($field, 'is mandatory');
                $field->addError($mandatory);

                // Go to the next field, no need to validate
                continue;
            }

            $validationResult = $field->validate();

            if ($validationResult) {
                $validationError = new ValidationError($field);
                $field->addError($validationError);
            }
        }
    }
1191418
public function validate()
    {
        $result = array();
        if(empty($this->slug)) $this->slug = $this->title;
        $this->slug = \lib\MyFunctions::slug($this->slug);
        if (empty($this->slug)) {
            $result['slug'] = Validate::cantLeaveBlank(_('Slug'));
        } else {
            $slugExists = self::checkSlug($this->slug,$this->id);
            if ($slugExists) {
                $result['slug'] = _('Repeated slug');
            }
        }
        if (empty($this->title)) {
            $result['title'] = Validate::cantLeaveBlank(_('Title'));
        }
        if (empty($this->description)) {
            $result['description'] = Validate::cantLeaveBlank(_('Description'));
        }

        return $result;
    }