Validates that ContractType keys in attr_dict reference existing manifest ContractTypes.
14494
def validate_attr_dict(self, attr_dict: Dict[str, str]) -> None:
        
        attr_dict_names = list(attr_dict.keys())

        if not self.unlinked_references and not self.linked_references:
            raise BytecodeLinkingError(
                "Unable to validate attr dict, this contract has no linked/unlinked references."
            )

        unlinked_refs = self.unlinked_references or ({},)
        linked_refs = self.linked_references or ({},)
        all_link_refs = unlinked_refs + linked_refs

        all_link_names = [ref["name"] for ref in all_link_refs]
        if set(attr_dict_names) != set(all_link_names):
            raise BytecodeLinkingError(
                "All link references must be defined when calling "
                "`link_bytecode` on a contract factory."
            )
        for address in attr_dict.values():
            if not is_canonical_address(address):
                raise BytecodeLinkingError(
                    f"Address: {address} as specified in the attr_dict is not "
                    "a valid canoncial address."
                )
1152868
def _validate(self, inst: "InstanceNode", scope: ValidationScope,
                  ctype: ContentType) -> None:
        """"""
        if (scope.value & ValidationScope.syntax.value and
                inst.value not in self.type):
            raise YangTypeError(inst.json_pointer(), self.type.error_tag,
                                self.type.error_message)
        if (isinstance(self.type, LinkType) and        # referential integrity
                scope.value & ValidationScope.semantics.value and
                self.type.require_instance):
            try:
                tgt = inst._deref()
            except YangsonException:
                tgt = []
            if not tgt:
                raise SemanticError(inst.json_pointer(), "instance-required")
        super()._validate(inst, scope, ctype)
1337566
public static final void checkTxAttrs(TransactionAttribute[] txAttrs,
                                          String[] methodNames, String[] methodSignatures,//PQ63130
                                          String[] checkedNames, String[] checkedSignatures,//PQ63130

                                          TransactionAttribute prescribedAttr)
    {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "checkTxAttrs");
        for (int i = 0; i < methodNames.length; ++i) {
            for (int j = 0; j < checkedNames.length; ++j) {

                //PQ63130 added check of method signature
                if (((methodNames[i].equals(checkedNames[j])) && (methodSignatures[i].equals(checkedSignatures[j]))) | checkedNames[j].equals("*")) {

                    txAttrs[i] = prescribedAttr;
                    break;
                }
            }
        }

        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(tc, "checkTxAttrs");

    }
90123
def _validate_version(self):
        
        self._assert_type("version", list(six.string_types))
        self._assert_matches_re("version", [RELEASE_VERSION_RE])
845060
def _check_key(self, key):
        
        self.setup_schema()
        if key not in self._attrs and key not in self:
            raise KeyError(key)
148275
def validate_auth_type(self):
        

        for handler in HANDLERS:
            handler_type = handler.split(".")[-2]
            
            if handler_type == self.auth_type:
                self.handler_name = handler
                
                return
        
        self.handler_name = None
921578
def _validate_other_keys(optional, types, missing, validated, data,
                         to_validate):
    """"""
    errors = []
    for key in to_validate:
        value = data[key]
        if key in optional:
            errors.extend(
                _validate_optional_key(
                    key, missing, value, validated, optional))
            continue
        errors.extend(_validate_type_key(key, value, types, validated))
    return errors
7739
def get_validated_attribute_type_info(typ, item_type, attr_name):
    
    if (typ is None) or (typ is Parameter.empty):
        raise TypeInformationRequiredError.create_for_object_attributes(item_type, attr_name, typ)

    # resolve forward references
    typ = resolve_forward_ref(typ)

    if not is_valid_pep484_type_hint(typ):
        raise InvalidPEP484TypeHint.create_for_object_attributes(item_type, attr_name, typ)

    return typ
349680
def _validate(self):
        
        for key in self:
            if key not in DEFAULTS:
                raise exceptions.ConfigurationException(
                    'Unknown configuration key "{}"! Valid configuration keys are'
                    " {}".format(key, list(DEFAULTS.keys()))
                )

        validate_queues(self["queues"])
        validate_bindings(self["bindings"])
        validate_client_properties(self["client_properties"])
153451
function validateInclusion(attr, conf, err) {
    if (nullCheck.call(this, attr, conf, err)) return;

    if (!~conf.in.indexOf(this[attr])) {
        err();
    }
}
526280
def _CheckForExistingMappings(mapping_type, message_type,
                              python_name, json_name):
    """"""
    if mapping_type == 'field':
        getter = GetCustomJsonFieldMapping
    elif mapping_type == 'enum':
        getter = GetCustomJsonEnumMapping
    remapping = getter(message_type, python_name=python_name)
    if remapping is not None and remapping != json_name:
        raise exceptions.InvalidDataError(
            'Cannot add mapping for %s "%s", already mapped to "%s"' % (
                mapping_type, python_name, remapping))
    remapping = getter(message_type, json_name=json_name)
    if remapping is not None and remapping != python_name:
        raise exceptions.InvalidDataError(
            'Cannot add mapping for %s "%s", already mapped to "%s"' % (
                mapping_type, json_name, remapping))
271235
def validate(cls, event_info):
        """"""
        assert 'service_key' in event_info
        assert isinstance(event_info['service_key'], six.string_types)
        assert 'event_type' in event_info
        assert event_info['event_type'] in cls.EVENT_TYPES
        if event_info['event_type'] != cls.EVENT_TYPES[0]:
            assert 'incident_key' in event_info
            assert isinstance(event_info['incident_key'], six.string_types)
        else:
            assert 'description' in event_info

        if 'details' in event_info:
            assert isinstance(event_info['details'], dict)

        if 'contexts' in event_info:
            assert isinstance(event_info['contexts'], (list, tuple,))
294383
def _detect(self):
        
        results = []
        for contract in self.contracts:
            deprecated_references = self.detect_deprecated_references_in_contract(contract)
            if deprecated_references:
                for deprecated_reference in deprecated_references:
                    source_object = deprecated_reference[0]
                    deprecated_entries = deprecated_reference[1]
                    info = 'Deprecated standard detected @ {}:\n'.format(source_object.source_mapping_str)

                    for (dep_id, original_desc, recommended_disc) in deprecated_entries:
                        info += "\t- Usage of \"{}\" should be replaced with \"{}\"\n".format(original_desc,
                                                                                              recommended_disc)


                    # Generate relevant JSON data for this deprecated standard.
                    json = self.generate_json_result(info)
                    if isinstance(source_object, StateVariableSolc) or isinstance(source_object, StateVariable):
                        self.add_variable_to_json(source_object, json)
                    else:
                        self.add_nodes_to_json([source_object], json)

                    results.append(json)

        return results
570107
private void validateKeyscope(final Attributes atts) {
        final String keys = atts.getValue(ATTRIBUTE_NAME_KEYSCOPE);
        if (keys != null) {
            for (final String key : keys.trim().split("\\s+")) {
                if (!isValidKeyName(key)) {
                    logger.error(MessageUtils.getMessage("DOTJ059E", key).toString());
                }
            }
        }
    }
884795
def validate(instance):
    

    jsonschema.validate(
        to_dict(instance, dict_type=dict), build_schema(instance.__class__)
    )
606163
def validate_json_field(dist, attr, value):
    

    try:
        is_json_compat(value)
    except ValueError as e:
        raise DistutilsSetupError("%r %s" % (attr, e))

    return True
409548
def check(cls, config, strict=False):  # type: (dict, bool) -> Dict[str, List[str]]
        
        result = {"errors": [], "warnings": []}
        # Schema validation errors
        validation_errors = validate_object(config, "poetry-schema")

        result["errors"] += validation_errors

        if strict:
            # If strict, check the file more thoroughly

            # Checking license
            license = config.get("license")
            if license:
                try:
                    license_by_id(license)
                except ValueError:
                    result["errors"].append("{} is not a valid license".format(license))

            if "dependencies" in config:
                python_versions = config["dependencies"]["python"]
                if python_versions == "*":
                    result["warnings"].append(
                        "A wildcard Python dependency is ambiguous. "
                        "Consider specifying a more explicit one."
                    )

            # Checking for scripts with extras
            if "scripts" in config:
                scripts = config["scripts"]
                for name, script in scripts.items():
                    if not isinstance(script, dict):
                        continue

                    extras = script["extras"]
                    for extra in extras:
                        if extra not in config["extras"]:
                            result["errors"].append(
                                'Script "{}" requires extra "{}" which is not defined.'.format(
                                    name, extra
                                )
                            )

        return result