Validate some assumptions about the new LocPathIterator and it's
owner and the state of the list.
12185
private static void validateNewAddition(Vector paths, ExpressionOwner owner, 
                                          LocPathIterator path) 
		throws RuntimeException 
  {
  	assertion(owner.getExpression() == path, "owner.getExpression() != path!!!");
	int n = paths.size();
	// There should never be any duplicates in the list!
	for(int i = 0; i < n; i++)
	{
		ExpressionOwner ew = (ExpressionOwner)paths.elementAt(i);
		assertion(ew != owner, "duplicate owner on the list!!!");
		assertion(ew.getExpression() != path, "duplicate expression on the list!!!");
	}
  }
1158528
def is_valid(self):
        ''''''
        return (self.is_primitive and self.name) \
            or (self.is_complex and self.name) \
            or (self.is_list and self.nested) \
            or (self.is_map and self.nested) \
            or (self.is_model and self.nested)
148882
def _validate_privileges(object_type, privs, privileges):
    '''
    
    '''
    if object_type != 'group':
        _perms = [_PRIVILEGES_MAP[perm]
                for perm in _PRIVILEGE_TYPE_MAP[object_type]]
        _perms.append('ALL')

        if object_type not in _PRIVILEGES_OBJECTS:
            raise SaltInvocationError(
                'Invalid object_type: {0} provided'.format(object_type))

        if not set(privs).issubset(set(_perms)):
            raise SaltInvocationError(
                'Invalid privilege(s): {0} provided for object {1}'.format(
                privileges, object_type))
    else:
        if privileges:
            raise SaltInvocationError(
                'The privileges option should not '
                'be set for object_type group')
621015
def ownership(self, ownership):
        
        error_msg = 'ownership must be a list of dictionaries'
        if ownership:
            if not isinstance(ownership, list):
                raise TypeError(error_msg)
            if not all([isinstance(item, dict) for item in ownership]):
                raise TypeError(error_msg)
            if not all([item.get('party_id') for item in ownership]):
                raise ValueError('Ownership missing one or more party_ids')
            if not all([item.get('split') for item in ownership]):
                raise ValueError('Ownership missing one or more splits')
            if sum([item.get('split') for item in ownership]) != Decimal('1'):
                raise ValueError('Ownership must sum up to 100%')
        self._ownership = ownership
328372
def is_valid(self):
        """"""
        if not self.total:
            return False
        if not self.contributor.freelanceprofile.is_freelance:
            return False
        return True
602399
def list_shoulds(options):
    
    validator_list = []

    # Default: enable all
    if not options.disabled and not options.enabled:
        validator_list.extend(CHECKS['all'])
        return validator_list

    # --disable
    # Add SHOULD requirements to the list unless disabled
    if options.disabled:
        if 'all' not in options.disabled:
            if 'format-checks' not in options.disabled:
                if 'custom-prefix' not in options.disabled:
                    validator_list.append(CHECKS['custom-prefix'])
                elif 'custom-prefix-lax' not in options.disabled:
                    validator_list.append(CHECKS['custom-prefix-lax'])
                if 'open-vocab-format' not in options.disabled:
                    validator_list.append(CHECKS['open-vocab-format'])
                if 'kill-chain-names' not in options.disabled:
                    validator_list.append(CHECKS['kill-chain-names'])
                if 'observable-object-keys' not in options.disabled:
                    validator_list.append(CHECKS['observable-object-keys'])
                if 'observable-dictionary-keys' not in options.disabled:
                    validator_list.append(CHECKS['observable-dictionary-keys'])
                if 'windows-process-priority-format' not in options.disabled:
                    validator_list.append(CHECKS['windows-process-priority-format'])
                if 'hash-length' not in options.disabled:
                    validator_list.append(CHECKS['hash-length'])

            if 'approved-values' not in options.disabled:
                if 'marking-definition-type' not in options.disabled:
                    validator_list.append(CHECKS['marking-definition-type'])
                if 'relationship-types' not in options.disabled:
                    validator_list.append(CHECKS['relationship-types'])
                if 'duplicate-ids' not in options.disabled:
                    validator_list.append(CHECKS['duplicate-ids'])
                if 'all-vocabs' not in options.disabled:
                    if 'attack-motivation' not in options.disabled:
                        validator_list.append(CHECKS['attack-motivation'])
                    if 'attack-resource-level' not in options.disabled:
                        validator_list.append(CHECKS['attack-resource-level'])
                    if 'identity-class' not in options.disabled:
                        validator_list.append(CHECKS['identity-class'])
                    if 'indicator-types' not in options.disabled:
                        validator_list.append(CHECKS['indicator-types'])
                    if 'industry-sector' not in options.disabled:
                        validator_list.append(CHECKS['industry-sector'])
                    if 'malware-types' not in options.disabled:
                        validator_list.append(CHECKS['malware-types'])
                    if 'report-types' not in options.disabled:
                        validator_list.append(CHECKS['report-types'])
                    if 'threat-actor-types' not in options.disabled:
                        validator_list.append(CHECKS['threat-actor-types'])
                    if 'threat-actor-role' not in options.disabled:
                        validator_list.append(CHECKS['threat-actor-role'])
                    if 'threat-actor-sophistication' not in options.disabled:
                        validator_list.append(CHECKS['threat-actor-sophistication'])
                    if 'tool-types' not in options.disabled:
                        validator_list.append(CHECKS['tool-types'])
                    if 'region' not in options.disabled:
                        validator_list.append(CHECKS['region'])
                    if 'hash-algo' not in options.disabled:
                        validator_list.append(CHECKS['hash-algo'])
                    if 'windows-pebinary-type' not in options.disabled:
                        validator_list.append(CHECKS['windows-pebinary-type'])
                    if 'account-type' not in options.disabled:
                        validator_list.append(CHECKS['account-type'])
                if 'all-external-sources' not in options.disabled:
                    if 'mime-type' not in options.disabled:
                        validator_list.append(CHECKS['mime-type'])
                    if 'protocols' not in options.disabled:
                        validator_list.append(CHECKS['protocols'])
                    if 'ipfix' not in options.disabled:
                        validator_list.append(CHECKS['ipfix'])
                    if 'http-request-headers' not in options.disabled:
                        validator_list.append(CHECKS['http-request-headers'])
                    if 'socket-options' not in options.disabled:
                        validator_list.append(CHECKS['socket-options'])
                    if 'pdf-doc-info' not in options.disabled:
                        validator_list.append(CHECKS['pdf-doc-info'])
                    if 'countries' not in options.disabled:
                        validator_list.append(CHECKS['countries'])

            if 'network-traffic-ports' not in options.disabled:
                validator_list.append(CHECKS['network-traffic-ports'])
            if 'extref-hashes' not in options.disabled:
                validator_list.append(CHECKS['extref-hashes'])

    # --enable
    if options.enabled:
        for check in options.enabled:
            try:
                if CHECKS[check] in validator_list:
                    continue

                if type(CHECKS[check]) is list:
                    validator_list.extend(CHECKS[check])
                else:
                    validator_list.append(CHECKS[check])
            except KeyError:
                raise JSONError("%s is not a valid check!" % check)

    return validator_list
884964
def validate(self, obj):
        """"""
        if 'tags' in obj and not isinstance(obj['tags'], list):
            raise aomi_excep.Validation('tags must be a list')

        if self.present:
            check_obj(self.required_fields, self.name(), obj)
654243
private static <T> boolean containsIdentity(List<T> list, T object) {
		for (T item : list) {
			if (item == object) {
				return true;
			}
		}
		return false;
	}
787587
def list
      Cli::Environments::EvaluateOnly.new(options).evaluate
      DslDescriber.new.list
    end
1164411
def DEFINE_list(self, name, default, help, constant=False):
    """"""
    self.AddOption(
        type_info.List(
            name=name,
            default=default,
            description=help,
            validator=type_info.String()),
        constant=constant)
1236102
def validate(self):
        
        assert self.role in ROLES, "Assumption Failed: Role must be one of the following {}".format(ROLES)
        assert isinstance(self.license, str) or isinstance(self.license, License), "Assumption Failed: License is not a string or license object"
        self.license.validate()
        # if self.required_file_format:
        #     files_valid = False
        #     #not any(f for f in self.files if isinstance(f, DownloadFile))
        #     for f in self.files:
        #         files_valid = files_valid or (f.path.endswith(self.required_file_format)
        #     assert files_valid , "Assumption Failed: Node should have at least one {} file".format(self.required_file_format)
        return super(ContentNode, self).validate()
244958
def verify(self):
        
        for expectation in self.exp_list:
            if hasattr(expectation, "verify") and not expectation.verify():
                return False
        return True
809416
function validSemverTag(list, tag) {
    if (semver.valid(tag)) {
        list.push(tag);
    }

    return list;
}
653169
def validate(schema, data, owner=None):
    
    schema._validate(data=data, owner=owner)
125964
def validate_owner_repo_identifier(ctx, param, value):
    """"""
    # pylint: disable=unused-argument
    form = "OWNER/REPO/IDENTIFIER"
    return validators.validate_slashes(param, value, minimum=3, maximum=3, form=form)
1059875
def verification_checks(self):
        
        if self._verification_checks is None:
            self._verification_checks = VerificationCheckList(self._version, service_sid=self._solution['sid'], )
        return self._verification_checks
1297406
def is_owner():
    

    async def predicate(ctx):
        if not await ctx.bot.is_owner(ctx.author):
            raise NotOwner('You do not own this bot.')
        return True

    return check(predicate)